From 9cfcf412db6f467b088ba914b5041db831b0ae64 Mon Sep 17 00:00:00 2001 From: Robert Fritzen Date: Sat, 2 Aug 2014 17:29:12 -0500 Subject: [PATCH] Fixed Some Mistakes --- scripts/TWM2/Systems/Killstreak.cs | 4 ++-- scripts/weapons/Construction/EditGun.cs | 8 ++++---- scripts/weapons/Construction/constructionTool.cs | 8 ++++---- scripts/weapons/Construction/modifiertool.cs | 8 ++++---- scripts/weapons/Construction/superChaingun.cs | 10 ++++++---- scripts/weapons/Equipment/SWBeaconer.cs | 8 ++++++++ 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/scripts/TWM2/Systems/Killstreak.cs b/scripts/TWM2/Systems/Killstreak.cs index f6c5345..a6dbc0b 100644 --- a/scripts/TWM2/Systems/Killstreak.cs +++ b/scripts/TWM2/Systems/Killstreak.cs @@ -322,10 +322,9 @@ function GameConnection::AwardKillstreak(%client, %streakVal, %plz) { if(!%client.isActiveStreak(%streakVal) && ($Killstreak::Setting != 2) && !$TWM::PlayingHelljump) { return; } - if(!%client.ksListInstance) { + if(!isSet(%client.ksListInstance)) { %client.ksListInstance = initList(); } - %client.player.setInventory(KillstreakBeacon, 1, true); %cAmt = 0; switch(%streakVal) { case 1: @@ -443,6 +442,7 @@ function GameConnection::AwardKillstreak(%client, %streakVal, %plz) { } } } + %client.player.setInventory(KillstreakBeacon, 1, true); } //Modified 12-17-09 to take into consideration of hosts changing the kill values diff --git a/scripts/weapons/Construction/EditGun.cs b/scripts/weapons/Construction/EditGun.cs index b5b6d92..d089915 100644 --- a/scripts/weapons/Construction/EditGun.cs +++ b/scripts/weapons/Construction/EditGun.cs @@ -103,11 +103,11 @@ datablock ShapeBaseImageData(EditGunImage) { function EditGunImage::onMount(%this, %obj, %slot) { Parent::onMount(%this, %obj, %slot); DispEditorToolInfo(%obj); - if(!isSet(%obj.EditPMode)) { - %obj.EditPMode = 0; + if(!isSet(%obj.client.EditPMode)) { + %obj.client.EditPMode = 0; } - if(!isSet(%obj.EditSMode)) { - %obj.EditSMode = 0; + if(!isSet(%obj.client.EditSMode)) { + %obj.client.EditSMode = 0; } //Phantom139: Added %obj.hasMineModes = 1; diff --git a/scripts/weapons/Construction/constructionTool.cs b/scripts/weapons/Construction/constructionTool.cs index ca8c448..97ca66a 100644 --- a/scripts/weapons/Construction/constructionTool.cs +++ b/scripts/weapons/Construction/constructionTool.cs @@ -221,10 +221,10 @@ function ConstructionToolImage::onMount(%this,%obj,%slot) { %obj.errMsgSent = false; %obj.client.setWeaponsHudActive(%this.item); %obj.usingConstructionTool = true; - if (!%obj.constructionToolMode) - %obj.constructionToolMode = 0; - if (!%obj.constructionToolMode2) - %obj.constructionToolMode2 = 0; + if (!isSet(%obj.client.constructionToolMode)) + %obj.client.constructionToolMode = 0; + if (!isSet(%obj.client.constructionToolMode2)) + %obj.client.constructionToolMode2 = 0; //Phantom139: Added %obj.hasMineModes = 1; %obj.hasGrenadeModes = 1; diff --git a/scripts/weapons/Construction/modifiertool.cs b/scripts/weapons/Construction/modifiertool.cs index 169ee4d..a0d778b 100644 --- a/scripts/weapons/Construction/modifiertool.cs +++ b/scripts/weapons/Construction/modifiertool.cs @@ -545,10 +545,10 @@ function MergeToolImage::onFire(%data,%obj,%slot) function MergeToolImage::onMount(%this,%obj,%slot) { - if(%obj.MTMode $= "") - %obj.MTMode = 0; - if(%obj.MTSubMode $= "") - %obj.MTSubMode = 0; + if(%obj.client.MTMode $= "") + %obj.client.MTMode = 0; + if(%obj.client.MTSubMode $= "") + %obj.client.MTSubMode = 0; %obj.usingMTelec = 1; //Phantom139: Added %obj.hasMineModes = 1; diff --git a/scripts/weapons/Construction/superChaingun.cs b/scripts/weapons/Construction/superChaingun.cs index 1bd991b..55f45ce 100644 --- a/scripts/weapons/Construction/superChaingun.cs +++ b/scripts/weapons/Construction/superChaingun.cs @@ -210,10 +210,10 @@ function SuperChaingunImage::onFire(%data,%obj,%slot) { function SuperChaingunImage::onMount(%this,%obj,%slot) { %obj.usingSuperChaingun = true; - if (!%obj.superChaingunMode) - %obj.superChaingunMode = 0; - if (!%obj.superChaingunMode2) - %obj.superChaingunMode2 = 0; + if (!%obj.client.superChaingunMode) + %obj.client.superChaingunMode = 0; + if (!%obj.client.superChaingunMode2) + %obj.client.superChaingunMode2 = 0; %obj.hasMineModes = 1; %obj.hasGrenadeModes = 1; displayWeaponInfo(%this, %obj, %obj.client.superChaingunMode, %obj.client.superChaingunMode2); @@ -238,6 +238,8 @@ function SuperChaingunImage::changeMode(%this, %obj, %key) { case 2: //Grenade Modes %obj.client.superChaingunMode2++; + if(%obj.client.superChaingunMode != 1) + %obj.client.superChaingunMode2 = 0; if (%obj.client.superChaingunMode == 1 && %obj.client.superChaingunMode2 == 2) %obj.client.superChaingunMode2 = 0; } diff --git a/scripts/weapons/Equipment/SWBeaconer.cs b/scripts/weapons/Equipment/SWBeaconer.cs index c34b244..9c639bb 100644 --- a/scripts/weapons/Equipment/SWBeaconer.cs +++ b/scripts/weapons/Equipment/SWBeaconer.cs @@ -73,6 +73,14 @@ datablock ShapeBaseImageData(KillstreakBeaconImage) { }; function KillstreakBeaconImage::onMount(%this, %obj, %slot) { + if(!isSet(%obj.client.ksListInstance)) { + %obj.client.ksListInstance = initList(); + } + if(%obj.client.ksListInstance.count() <= 0) { + %obj.throwWeapon(1); + %obj.throwWeapon(0); + %obj.setInventory(KillstreakBeacon, 0, true); + } Parent::onMount(%this, %obj, %slot); %obj.hasMineModes = 1; %obj.hasGrenadeModes = 1;