DEADSOFTWARE

Player: Fix follow corpses at client side
authorStas'M <x86corez@gmail.com>
Tue, 25 Sep 2018 11:11:30 +0000 (14:11 +0300)
committerStas'M <x86corez@gmail.com>
Tue, 25 Sep 2018 11:31:17 +0000 (14:31 +0300)
src/game/g_player.pas

index c65d7206064025f82998691f1ada73203f575c7a..94c28712ff81fb6f4a079882de8f355c0ed847fd 100644 (file)
@@ -1512,11 +1512,20 @@ end;
 
 procedure g_Player_CreateCorpse(Player: TPlayer);
 var
+  i: Integer;
   find_id: DWORD;
   ok: Boolean;
 begin
   if Player.alive then
     Exit;
+
+// Ðàçðûâàåì ñâÿçü ñ ïðåæíèì òðóïîì:
+  if gCorpses <> nil then
+    for i := 0 to High(gCorpses) do
+      if gCorpses[i] <> nil then
+        if gCorpses[i].FPlayerUID = Player.FUID then
+          gCorpses[i].FPlayerUID := 0;
+
   if Player.FObj.Y >= gMapInfo.Height+128 then
     Exit;
 
@@ -4518,13 +4527,6 @@ begin
       FRulez := [];
   end;
 
-// Ðàçðûâàåì ñâÿçè ñ òðóïàìè:
-  if gCorpses <> nil then
-    for a := 0 to High(gCorpses) do
-      if gCorpses[a] <> nil then
-        if gCorpses[a].FPlayerUID = FUID then
-          gCorpses[a].FPlayerUID := 0;
-
 // Ïîëó÷àåì êîîðäèíàòû òî÷êè âîçðîæäåíèÿ:
   if not g_Map_GetPoint(c, RespawnPoint) then
   begin