-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
acceptedThe idea got accepted to be in the gameThe idea got accepted to be in the gamebugSomething isn't workingSomething isn't workingimportedImported to internal gitImported to internal git
Description
Before You Report
- I have searched for existing reports of this bug, and this bug report is unique.
Version
1.1.4.2
Description
RoleExtensions.TryGetRandomSpawnPoint may throw a NullReferenceException for certain roles that implement IFpcRole.
The method assumes that all IFpcRole implementations have a non-null SpawnpointHandler, but in practice this is not always true (e.g. Scp0492).
To Reproduce
RoleTypeId.Scp0492.TryGetRandomSpawnPoint(out Vector3 position, out float rotation);
Expected Behavior
The method should safely return false when no spawn point is available, without throwing exceptions.
Additional Information
[ERROR] [LabApi] 'NullReferenceException' occurred while invoking 'OnServerRoundStarted' on '***': 'Object reference not set to an instance of an object', stack trace:
at LabApi.Features.Extensions.RoleExtensions.TryGetRandomSpawnPoint (PlayerRoles.RoleTypeId role, UnityEngine.Vector3& position, System.Single& horizontalRotation) [0x00010] in <9e8e00107de94d4f8ea9fc96c93d382f>:0
at ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedThe idea got accepted to be in the gameThe idea got accepted to be in the gamebugSomething isn't workingSomething isn't workingimportedImported to internal gitImported to internal git