prevent drilling into hogs w/ drill rocket
authornemo
Fri, 22 Feb 2013 21:44:00 -0500
changeset 8564 dadfda4ba248
parent 8562 d9d1cb650ff8
child 8566 d9627d65edf7
child 8567 a31c453c6070
prevent drilling into hogs w/ drill rocket
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Fri Feb 22 19:24:59 2013 -0500
+++ b/hedgewars/GSHandlers.inc	Fri Feb 22 21:44:00 2013 -0500
@@ -2876,6 +2876,7 @@
 var 
     t: PGearArray;
     ox, oy: hwFloat;
+    tempColl: Word; 
 begin
     AllInactive := false;
 
@@ -2894,11 +2895,12 @@
             exit
         end
     end;
-
-    if GameTicks > Gear^.FlightTime then
+    tempColl:= Gear^.CollisionMask;
+    Gear^.CollisionMask:= $007F;
+    if (TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) <> 0) or TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) or (GameTicks > Gear^.FlightTime) then
         t := CheckGearsCollision(Gear)
-        
     else t := nil;
+    Gear^.CollisionMask:= tempColl;
     //fixes drill not exploding when touching HH bug
     
     if (Gear^.Timer = 0) or ((t <> nil) and (t^.Count <> 0))