AI: No longer afraid of heights if invulnerable
authorWuzzy <Wuzzy2@mail.ru>
Mon, 06 Jul 2020 16:55:35 +0200
changeset 15693 2aedd8ca836c
parent 15692 e55c4bad720a
child 15694 2a69c6693fbb
AI: No longer afraid of heights if invulnerable
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIMisc.pas	Mon Jul 06 16:46:38 2020 +0200
+++ b/hedgewars/uAIMisc.pas	Mon Jul 06 16:55:35 2020 +0200
@@ -1136,7 +1136,8 @@
         begin
         inc(GoInfo.Ticks);
         Gear^.dY:= Gear^.dY + aiGravity;
-        if Gear^.dY > _0_4 then
+        // taking fall damage?
+        if (Gear^.dY > _0_4) and (Gear^.Hedgehog^.Effects[heInvulnerable] = 0) then
             begin
             GoInfo.FallPix:= 0;
             // try ljump instead of fall with damage