DEADSOFTWARE

always search for new state slots
authorfgsfds <pvt.fgsfds@gmail.com>
Sun, 1 Mar 2020 23:51:44 +0000 (02:51 +0300)
committerfgsfds <pvt.fgsfds@gmail.com>
Sun, 1 Mar 2020 23:51:44 +0000 (02:51 +0300)
src/game/g_player.pas

index fe38642843d48311e9169bb13b93973c9fcfa0b5..90588ba10e31d4be1d60592fad315687274c8aff 100644 (file)
@@ -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;