DEADSOFTWARE

fixed segfault in bot ai
[d2df-sdl.git] / src / game / g_player.pas
index e1075d40b3d6263db60343dd0349ac33b122d2b0..b6a6bc16f507b818f7b7ffc6491cfff79b3adb1a 100644 (file)
@@ -2884,8 +2884,6 @@ end;
 
 procedure TPlayer.CatchFire(Attacker: Word);
 begin
-  if FMegaRulez[MR_SUIT] > 0 then
-    Exit;
   FFireTime := 100;
   FFireAttacker := Attacker;
   if g_Game_IsNet and g_Game_IsServer then
@@ -4850,6 +4848,12 @@ begin
         FFireTime := 0;
         FFirePainTime := 0;
       end
+      else if FMegaRulez[MR_SUIT] >= gTime then
+      begin
+        if FMegaRulez[MR_SUIT] = gTime then
+          FFireTime := 1;
+        FFirePainTime := 0;
+      end
       else
       begin
         OnFireFlame(1);
@@ -6220,7 +6224,7 @@ var
   firew, fireh: Integer;
   angle: SmallInt;
   mon: TMonster;
-  pla: TPlayer;
+  pla, tpla: TPlayer;
   vsPlayer, vsMonster, ok: Boolean;
 begin
   vsPlayer := LongBool(gGameSettings.Options and GAME_OPTION_BOTVSPLAYER);
@@ -6254,14 +6258,16 @@ begin
       if (g_GetUIDType(Target.UID) = UID_PLAYER) and
           vsPlayer then
         begin // Èãðîê
-          with g_Player_Get(Target.UID) do
-            begin
-              if (@FObj) <> nil then
+          tpla := g_Player_Get(Target.UID);
+          if tpla <> nil then
+            with tpla do
               begin
-                Target.X := FObj.X;
-                Target.Y := FObj.Y;
+                if (@FObj) <> nil then
+                begin
+                  Target.X := FObj.X;
+                  Target.Y := FObj.Y;
+                end;
               end;
-            end;
 
           Target.cX := Target.X + PLAYER_RECT_CX;
           Target.cY := Target.Y + PLAYER_RECT_CY;