LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[BUG]: PlayerSpawningEventArgs.UseSpawnPoint returns incorrect state

Open CCrous opened this issue 6 months ago • 0 comments

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

  1. Use a role with a valid SpawnpointHandler
  2. Do not set RoleSpawnFlags.UseSpawnpoint
  3. 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

CCrous avatar May 26 '26 10:05 CCrous