From 685297171ca437efacbe25431c3a58d2af4292ba Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 31 Dec 2024 20:01:47 -0600 Subject: [PATCH] npc manager error spam --- src/engine/gameManager/NPCManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 5da96eb8..6d7ff484 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -354,7 +354,18 @@ public enum NPCManager { // Rotate slot position by the building rotation - abstractCharacter.bindLoc = Vector3fImmutable.rotateAroundPoint(abstractCharacter.building.getLoc(), abstractCharacter.bindLoc, abstractCharacter.building.getBounds().getQuaternion().angleY); + if (abstractCharacter != null && abstractCharacter.building != null && abstractCharacter.bindLoc != null + && abstractCharacter.building.getLoc() != null && abstractCharacter.building.getBounds() != null + && abstractCharacter.building.getBounds().getQuaternion() != null) { + abstractCharacter.bindLoc = Vector3fImmutable.rotateAroundPoint( + abstractCharacter.building.getLoc(), + abstractCharacter.bindLoc, + abstractCharacter.building.getBounds().getQuaternion().angleY + ); + } else { + Logger.error("Null value detected in abstractCharacter or its properties. Skipping rotation logic."); + // Handle the case where one or more objects are null, if needed + } abstractCharacter.loc = new Vector3fImmutable(abstractCharacter.bindLoc);