From 14a29c861231a6423cdc446a9f8cf384d52c586f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 29 Dec 2024 18:37:42 -0600 Subject: [PATCH] fixed NPC interaction --- src/engine/gameManager/BuildingManager.java | 2 +- src/engine/net/client/msg/VendorDialogMsg.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index 2ef18c57..0c1eb3df 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -438,7 +438,7 @@ public enum BuildingManager { public static boolean IsPlayerHostile(Building building, PlayerCharacter player) { - if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BANESTONE)) + if(building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.BANESTONE)) { Guild playerNation = player.guild.getNation(); City banedCity = ZoneManager.getCityAtLocation(building.loc); diff --git a/src/engine/net/client/msg/VendorDialogMsg.java b/src/engine/net/client/msg/VendorDialogMsg.java index 3682996e..f9387e6a 100644 --- a/src/engine/net/client/msg/VendorDialogMsg.java +++ b/src/engine/net/client/msg/VendorDialogMsg.java @@ -128,7 +128,7 @@ public class VendorDialogMsg extends ClientNetMsg { if (contract == null) vd = VendorDialog.getHostileVendorDialog(); else if (npc.getBuilding() != null) { - if (BuildingManager.IsPlayerHostile(npc.getBuilding(), playerCharacter)) + if (npc.getBuilding() != null && BuildingManager.IsPlayerHostile(npc.getBuilding(), playerCharacter)) vd = VendorDialog.getHostileVendorDialog(); else vd = contract.getVendorDialog();