AI: Reset remembered gravity on Think and TestAmmos
authorWuzzy <Wuzzy2@mail.ru>
Mon, 06 Jul 2020 16:46:38 +0200
changeset 15714 e55c4bad720a
parent 15713 c6675acd3c82
child 15715 2aedd8ca836c
AI: Reset remembered gravity on Think and TestAmmos
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Mon Jul 06 15:41:22 2020 +0200
+++ b/hedgewars/uAI.pas	Mon Jul 06 16:46:38 2020 +0200
@@ -107,6 +107,8 @@
 BotLevel:= Me^.Hedgehog^.BotLevel;
 aiWindSpeed:= hwFloat2Float(cWindSpeed);
 aiLaserSighting:= (cLaserSighting) or (HHHasAmmo(Me^.Hedgehog^, amLaserSight) > 0);
+aiGravity:= cGravity;
+aiGravityf:= cGravityf;
 hasLowGrav:= HHHasAmmo(Me^.Hedgehog^, amLowGravity) > 0;
 useThisActions:= false;
 Me^.AIHints:= Me^.AIHints and (not aihAmmosChanged);
@@ -293,6 +295,8 @@
             or StopThinking
         end
 end;
+aiGravity:= cGravity;
+aiGravityf:= cGravityf;
 end;
 
 procedure Walk(Me: PGear; var Actions: TActions);
@@ -481,6 +485,8 @@
     Actions: TActions;
 begin
 dmgMod:= 0.01 * hwFloat2Float(cDamageModifier) * cDamagePercent;
+aiGravity:= cGravity;
+aiGravityf:= cGravityf;
 StartTicks:= GameTicks;
 
 currHedgehogIndex:= CurrentTeam^.CurrHedgehog;