remove debug message, clear a couple of global gear references if appropriate, fix control script
authornemo
Thu, 08 Sep 2011 00:29:01 -0400
changeset 5806 6778f0a7d896
parent 5805 a0e81ddb0fd4
child 5807 5c8fe58dead5
remove debug message, clear a couple of global gear references if appropriate, fix control script
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
share/hedgewars/Data/Maps/Control/map.lua
--- a/hedgewars/GSHandlers.inc	Wed Sep 07 20:54:32 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Thu Sep 08 00:29:01 2011 -0400
@@ -4948,6 +4948,8 @@
 	    AfterAttack;
             if Gear = CurAmmoGear then CurAmmoGear := nil;
             DeleteCI(HH^.Gear);
+            if FollowGear = HH^.Gear then FollowGear:= nil;
+            if lastGearByUID = HH^.Gear then lastGearByUID := nil;
             RemoveGearFromList(HH^.Gear);
             with HH^.Gear^ do
                 begin
--- a/hedgewars/uGears.pas	Wed Sep 07 20:54:32 2011 -0400
+++ b/hedgewars/uGears.pas	Thu Sep 08 00:29:01 2011 -0400
@@ -1747,7 +1747,6 @@
 if (t > 0) then
     begin
     t:= GetRandom(t);
-    AddFileLog(inttostr(t)+' --------------');
     while t >= 0 do
       begin
       inc(i);
--- a/share/hedgewars/Data/Maps/Control/map.lua	Wed Sep 07 20:54:32 2011 -0400
+++ b/share/hedgewars/Data/Maps/Control/map.lua	Thu Sep 08 00:29:01 2011 -0400
@@ -159,26 +159,27 @@
 		SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff)
 		cOwnerClan[i] = nil
 		for k = 0, (numhhs-1) do
-			if (hhs[k] ~= nil) then
-			if (GearIsInZone(hhs[k],i)) == true then
+			if (hhs[k] ~= nil) and (GetGearType(hhs[k]) ~= nil) then
+                if (GearIsInZone(hhs[k],i)) == true then
 
-				if cOwnerClan[i] ~= nil then
-					if cOwnerClan[i] ~= GetHogClan(hhs[k]) then 
-						--if the hog now being compared is different to one that is also here and was previously compared
-						
-						SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff)						
-						--SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, 0xffffffff)
-	
-						cOwnerClan[i] = 10 -- this means conflicted
-					end
-				elseif cOwnerClan[i] == nil then
-					cOwnerClan[i] = GetHogClan(hhs[k])
-					--SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, GetClanColor( GetHogClan(hhs[k])) )
-					SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], GetClanColor( GetHogClan(hhs[k])))
-	
-				end
+                    if cOwnerClan[i] ~= nil then
+                        if cOwnerClan[i] ~= GetHogClan(hhs[k]) then 
+                            --if the hog now being compared is different to one that is also here and was previously compared
+                            
+                            SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff)						
+                            --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, 0xffffffff)
+        
+                            cOwnerClan[i] = 10 -- this means conflicted
+                        end
+                    elseif cOwnerClan[i] == nil then
+                        cOwnerClan[i] = GetHogClan(hhs[k])
+                        --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, GetClanColor( GetHogClan(hhs[k])) )
+                        SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], GetClanColor( GetHogClan(hhs[k])))
+        
+                    end
 
-			end
+                end
+            else hhs[k] = nil
 			end
 		end