From: DeaDDooMER Date: Thu, 16 Feb 2023 18:51:54 +0000 (+0300) Subject: shells: fix shell reset on map start X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=d4203c92b7d37c1b7b6aff994251035aafa388ca;p=d2df-sdl.git shells: fix shell reset on map start --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 3ad4510..d1bab90 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -1484,7 +1484,7 @@ begin {$IFDEF ENABLE_GIBS} g_Gibs_RemoveAll; {$ENDIF} - {$IFDEF ENALBE_SHELLS} + {$IFDEF ENABLE_SHELLS} g_Shells_RemoveAll; {$ENDIF} {$IFDEF ENABLE_CORPSES} @@ -3439,7 +3439,7 @@ begin {$IFDEF ENABLE_GIBS} g_Gibs_RemoveAll; {$ENDIF} - {$IFDEF ENALBE_SHELLS} + {$IFDEF ENABLE_SHELLS} g_Shells_RemoveAll; {$ENDIF} {$IFDEF ENABLE_CORPSES} @@ -3778,7 +3778,7 @@ begin {$IFDEF ENABLE_GIBS} g_Gibs_RemoveAll; {$ENDIF} - {$IFDEF ENALBE_SHELLS} + {$IFDEF ENABLE_SHELLS} g_Shells_RemoveAll; {$ENDIF} {$IFDEF ENABLE_CORPSES} diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 2652bc5..bd2bb6f 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2141,7 +2141,7 @@ begin {$IFDEF ENABLE_GIBS} g_Gibs_RemoveAll; {$ENDIF} - {$IFDEF ENALBE_SHELLS} + {$IFDEF ENABLE_SHELLS} g_Shells_RemoveAll; {$ENDIF} {$IFDEF ENABLE_CORPSES} diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index f17f34d..5bf8974 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -42,6 +42,9 @@ uses {$IFDEF ENABLE_CORPSES} g_corpses, {$ENDIF} + {$IFDEF ENABLE_SHELLS} + g_shells, + {$ENDIF} MAPDEF, utils, xstreams, g_game, g_items, g_map, g_monsters, g_triggers, g_basic, Math, wadreader, @@ -206,7 +209,7 @@ begin {$IFDEF ENABLE_GIBS} g_Gibs_RemoveAll; {$ENDIF} - {$IFDEF ENALBE_SHELLS} + {$IFDEF ENABLE_SHELLS} g_Shells_RemoveAll; // ??? {$ENDIF} {$IFDEF ENABLE_CORPSES} diff --git a/src/game/g_shells.pas b/src/game/g_shells.pas index 6e2e61e..99864d9 100644 --- a/src/game/g_shells.pas +++ b/src/game/g_shells.pas @@ -135,9 +135,9 @@ implementation procedure g_Shells_RemoveAll; var i: Integer; begin - i := g_Shells_GetMax(); - g_Shells_SetMax(0); - g_Shells_SetMax(i); + if gShells <> nil then + for i := 0 to High(gShells) do + gShells[i].alive := false; end; procedure g_Shells_SoundBounce(X, Y: Integer; T: Byte);