Browse Source

various console error fixes

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
409f8aa847
  1. 9
      src/engine/loot/ModTableEntry.java
  2. 2
      src/engine/math/Bounds.java
  3. 5
      src/engine/mobileAI/MobAI.java
  4. 4
      src/engine/net/client/handlers/ActivateNPCMsgHandler.java

9
src/engine/loot/ModTableEntry.java

@ -34,10 +34,15 @@ public class ModTableEntry {
itemTableEntryList = LootManager._modTables.get(modTablwe); itemTableEntryList = LootManager._modTables.get(modTablwe);
for (ModTableEntry iteration : itemTableEntryList) if(itemTableEntryList == null)
return null;
for (ModTableEntry iteration : itemTableEntryList) {
if (iteration == null)
continue;
if (roll >= iteration.minRoll && roll <= iteration.maxRoll) if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
modTableEntry = iteration; modTableEntry = iteration;
}
return modTableEntry; return modTableEntry;
} }
} }

2
src/engine/math/Bounds.java

@ -220,7 +220,7 @@ public class Bounds {
//player is inside building region, skip collision check. we only do collision from the outside. //player is inside building region, skip collision check. we only do collision from the outside.
if (player.region != null && player.region.parentBuildingID == building.getObjectUUID()) if (player.region != null && player.region.parentBuildingID == building.getObjectUUID())
continue; continue;
if (building.getBounds().colliders == null) if (building.getBounds() == null || building.getBounds().colliders == null)
continue; continue;
for (Colliders collider : building.getBounds().colliders) { for (Colliders collider : building.getBounds().colliders) {

5
src/engine/mobileAI/MobAI.java

@ -155,7 +155,9 @@ public class MobAI {
public static void AttackBuilding(Mob mob, Building target) { public static void AttackBuilding(Mob mob, Building target) {
try { try {
if(target == null){
return;
}
if (target.getRank() == -1 || !target.isVulnerable() || BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { if (target.getRank() == -1 || !target.isVulnerable() || BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
@ -202,6 +204,7 @@ public class MobAI {
} }
} catch (Exception e) { } catch (Exception e) {
mob.setCombatTarget(null);
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackBuilding" + " " + e.getMessage()); Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackBuilding" + " " + e.getMessage());
} }
} }

4
src/engine/net/client/handlers/ActivateNPCMsgHandler.java

@ -126,7 +126,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
return false; return false;
// Check if contract can be slotted in this building // Check if contract can be slotted in this building
Logger.error("inserting contract: " + contract.getContractID()); //Logger.error("inserting contract: " + contract.getContractID());
if (contract.canSlotinBuilding(building) == false) { if (contract.canSlotinBuilding(building) == false) {
boolean override = false; boolean override = false;
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) { if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) {
@ -152,7 +152,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
return false; return false;
} }
} }
Logger.error("override successful: " + contract.getContractID()); //Logger.error("override successful: " + contract.getContractID());
if (!BuildingManager.addHireling(building, player, zone, contract, contractItem)) if (!BuildingManager.addHireling(building, player, zone, contract, contractItem))
return false; return false;

Loading…
Cancel
Save