Browse Source

npc manager error spam

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
685297171c
  1. 13
      src/engine/gameManager/NPCManager.java

13
src/engine/gameManager/NPCManager.java

@ -354,7 +354,18 @@ public enum NPCManager {
// Rotate slot position by the building rotation // 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); abstractCharacter.loc = new Vector3fImmutable(abstractCharacter.bindLoc);

Loading…
Cancel
Save