From: fgsfds Date: Sun, 1 Mar 2020 23:51:44 +0000 (+0300) Subject: always search for new state slots X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=39b5a33c63812024e33054658dad9bc72aebe4ac;p=d2df-sdl.git always search for new state slots --- diff --git a/src/game/g_player.pas b/src/game/g_player.pas index fe38642..90588ba 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -5974,22 +5974,18 @@ begin SavedState.MaxAmmo[i] := FMaxAmmo[i]; SavedState.Rulez := FRulez - [R_KEY_RED, R_KEY_GREEN, R_KEY_BLUE]; - if FSavedStateNum < 0 then - begin - for i := Low(SavedStates) to High(SavedStates) do - if not SavedStates[i].Used then - begin - FSavedStateNum := i; - break; - end; - if FSavedStateNum < 0 then + for i := Low(SavedStates) to High(SavedStates) do + if not SavedStates[i].Used then begin - SetLength(SavedStates, Length(SavedStates) + 1); - FSavedStateNum := High(SavedStates); + FSavedStateNum := i; + break; end; + if FSavedStateNum < 0 then + begin + SetLength(SavedStates, Length(SavedStates) + 1); + FSavedStateNum := High(SavedStates); end; - SavedState.Used := True; SavedStates[i] := SavedState; end;