-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
bugSomething 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 ...
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingimportedImported to internal gitImported to internal git