Fix: Prevent spawning player from multiple spawn points #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "noahg/prevent-spawning-player-from-multiple-spawn-points"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This fixes an issue where multiple spawn points could be enabled by mistake and cause extra player instances to be spawned when starting a level.
The reason for this issue is because the existing system for choosing the player spawn point failed to make the options mutually exclusive.
This change makes it impossible to enable more than one spawn point by extracting the player spawning responsibility into a separate
PlayerSpawnerclass which exports a singlePlayerSpawnPointreference variable.This implementation also fixes a bug where under the right conditions when the level was started no player would be spawned with no error message and no fallback.
The bug happens when the DebugConfig's start locations dictionary contains an entry for a level scene path mapped to a non-existant spawn point name.
This is an easy situation to get into if the DebugConfig was set to use a spawn point that later got deleted or renamed.
6590a97afbto7a56d2c9337a56d2c933toda3327c938