Skip to content

Fix banlist being cleared if server fails to start

Hanicef requested to merge Hanicef/SRB2:fix-banlist-cleared-startup-error into next

If a server failed to start up properly, the banlist was erased. This happened because of the game saving the banlist every time the server shuts down, but if the server would shut down before it loaded the banlist, it would end up saving the default banlist, which is empty and thus erasing the list.

The easiest way to reproduce this is by starting the server with the -warp parameter specifying an invalid map. This will cause the server to return an error upon startup and fail to start, triggering the bug.

The fix solves it by storing a boolean if the banlist has been loaded first, and prevents saving the banlist in case it was never loaded.

Edited by Hanicef

Merge request reports

Loading