-
-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Improve restart command #7328
Conversation
I'm not sure I would expect |
I think such makes sense for competitive servers which re-run the same scenario. Could be argued that 'restart' generates a new map with current newgame settings while 'reload' restarts the currently loaded map / savegame. |
Yes, a |
Here's what i intuitively would think
but don't do anything special with savegames. |
That would mean, a reference to the original scenario/heightmap must be stored in savegames, and this reference must still work if the file was moved (fallback to 2. if it was not found) |
How about the Quake approach - have a variable/setting containing a console command to execute on game end? That command could be a simple |
i don't see how that has anything to do with the topic being discussed. this is about what the |
At the moment, in trunk, if you use Hence, I don't understand your |
Why would you make savegames stand out? Savegames and scenarios are kind of the same resource. To me they are interchangeable. |
they might be interchangable on a technical level, but not really at a logical/usage level.
you could make that savegame into a scenario, then start from that scenario. but what about the reverse? what if you loaded a backup savegame because of some griefers that messed everything up? you'd restart from that instead of the original one in your way. |
It is true I got carried away by the technical level, as I did not have a point of reference for semantics in OpenTTD. Savegames & scenarios are literally the same, except the former did not necessarily come from the editor... I made some changes to only intercept savegames in editor mode. Would that be satisfactory? |
0e6a350
to
e13ac77
Compare
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
Ping? |
4b2718f
to
1fdd16c
Compare
8715f42
to
4279881
Compare
When the restart command is issued, a normal map is always spawned. This improvement takes into account the current state of _file_to_saveload to check if a savegame/scenario/heightmap was previously loaded, and loads the same resource again.
@@ -1078,7 +1078,22 @@ void SwitchToMode(SwitchMode new_mode) | |||
MakeNewEditorWorld(); | |||
break; | |||
|
|||
case SM_RESTARTGAME: // Restart --> 'Random game' with current settings | |||
case SM_RESTARTGAME: // Restart --> Current settings preserved | |||
if (_file_to_saveload.abstract_ftype == FT_SAVEGAME || _file_to_saveload.abstract_ftype == FT_SCENARIO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes to only intercept savegames in editor mode. Would that be satisfactory?
I don't think it would, tbh. Would just be a confusing edgecase.
Besides, when could this actually happen? You can't load savegames into the editor, only scenarios (even if they're just savegames renamed to .scn extension)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You refer to a reply from 13 months ago, on a codebase which has changed since then.
I do not understand your comment in the context on the discussion you quote, applied to unrelated code?
What are you expecting to see?
I don't like this feature at all. That effort seems to have gone forgotten with this feature now in master. |
When the
restart
command is issued, a normal map is always spawned.This improvement takes into account the current state of
_file_to_saveload
to check if a savegame/scenario/heightmap was previously loaded, and loads the same resource again.