From: Stas'M Date: Mon, 24 Sep 2018 14:46:33 +0000 (+0300) Subject: Player: Don't follow corpse after respawn X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=c146ab01667396f6b030e131e05cb6ce90aaff04;p=d2df-sdl.git Player: Don't follow corpse after respawn --- diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 6cc70f5..ca23ce3 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -4518,6 +4518,13 @@ 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 @@ -4844,20 +4851,19 @@ begin Exit; if (gCorpses = nil) or (Length(gCorpses) = 0) then Exit; - if gCorpses <> nil then - for i := 0 to High(gCorpses) do - if gCorpses[i] <> nil then - if gCorpses[i].FPlayerUID = FUID then - begin - Result := True; - FObj.X := gCorpses[i].FObj.X; - FObj.Y := gCorpses[i].FObj.Y; - FObj.Vel.X := gCorpses[i].FObj.Vel.X; - FObj.Vel.Y := gCorpses[i].FObj.Vel.Y; - FObj.Accel.X := gCorpses[i].FObj.Accel.X; - FObj.Accel.Y := gCorpses[i].FObj.Accel.Y; - break; - end; + for i := 0 to High(gCorpses) do + if gCorpses[i] <> nil then + if gCorpses[i].FPlayerUID = FUID then + begin + Result := True; + FObj.X := gCorpses[i].FObj.X; + FObj.Y := gCorpses[i].FObj.Y; + FObj.Vel.X := gCorpses[i].FObj.Vel.X; + FObj.Vel.Y := gCorpses[i].FObj.Vel.Y; + FObj.Accel.X := gCorpses[i].FObj.Accel.X; + FObj.Accel.Y := gCorpses[i].FObj.Accel.Y; + break; + end; end; procedure TPlayer.Update();