[1.1.107] Player being renamed on load

Post your bugs and problems so we can fix them.
Post Reply
User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 87
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

[1.1.107] Player being renamed on load

Post by Cooldude2606 »

When a multiplayer game is saved and then loaded in singleplayer, if you do not exist in the save game then the player with index 1 will be renamed to match your name. This is inconsistent with loading single player save games where you play as index 1 but the player is not renamed.

This results in a scenario where `on_player_joined_game` is raised with a player who's name was never raised by `on_player_created`.
This causes issues where on join has a dependency on actions performed within on created, such as modifying the global table.
It also contradicts previous comments about player names not changing.

Reproduction Steps:
  1. Start a new multiplayer game.
  2. Save the game (A).
  3. Change your name in the settings.
  4. Load (SP) save A and note that you are playing as index 1 without being renamed. (expected)
  5. Host (MP) save A and note that you are playing as index 2 as a new player. (expected)
  6. Save the game (B).
  7. Load (SP) save B and note that you are playing as index 2 as the same player. (expected)
  8. Change your name in the settings.
  9. Load (SP) save B and note that you are playing as index 1 but have been renamed. (unexpected)
This was found while investigating a bug report for a mod but was reproducible in vanilia.
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---

Post Reply

Return to “Bug Reports”