Fix: Prevent spawning player from multiple spawn points #43

Merged
noahg merged 3 commits from noahg/prevent-spawning-player-from-multiple-spawn-points into dev 2026-03-28 04:03:22 +00:00
Member

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 PlayerSpawner class which exports a single PlayerSpawnPoint reference 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.

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 `PlayerSpawner` class which exports a single `PlayerSpawnPoint` reference 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.
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 PlayerSpawner class which exports a single PlayerSpawnPoint reference variable.
noahg force-pushed noahg/prevent-spawning-player-from-multiple-spawn-points from 6590a97afb to 7a56d2c933 2026-03-27 23:22:05 +00:00 Compare
noahg force-pushed noahg/prevent-spawning-player-from-multiple-spawn-points from 7a56d2c933 to da3327c938 2026-03-27 23:23:25 +00:00 Compare
xury approved these changes 2026-03-28 03:48:11 +00:00
noahg deleted branch noahg/prevent-spawning-player-from-multiple-spawn-points 2026-03-28 04:03:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BUGJam/pounce-game!43
No description provided.