LabAPI
LabAPI copied to clipboard
[BUG]: PlayerSpawningEventArgs.UseSpawnPoint returns incorrect state
Before You Report
- [x] I have searched for existing reports of this bug, and this bug report is unique.
Version
14.2.6
Description
PlayerSpawningEventArgs.UseSpawnPoint is currently initialized using:
fpcRole.SpawnpointHandler.TryGetSpawnpoint(out spawnLocation, out horizontalRotation)
However, the returned bool only indicates whether the role has a spawnpoint available, not whether this spawn should actually use a spawnpoint.
The real condition is:
newRole.ServerSpawnFlags.HasFlag(RoleSpawnFlags.UseSpawnpoint)
As a result, UseSpawnPoint can be inconsistent with the actual spawn behavior.
To Reproduce
- Use a role with a valid
SpawnpointHandler - Do not set
RoleSpawnFlags.UseSpawnpoint - Listen to
PlayerSpawningEventArgs
UseSpawnPoint still be true
Expected Behavior
UseSpawnPoint should be based on:
Role.ServerSpawnFlags.HasFlag(RoleSpawnFlags.UseSpawnpoint)
instead of the return value of TryGetSpawnpoint.
Additional Information
nope