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 { @@ -34,10 +34,15 @@ public class ModTableEntry {
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)
modTableEntry = iteration;
}
return modTableEntry;
}
}

2
src/engine/math/Bounds.java

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

5
src/engine/mobileAI/MobAI.java

@ -155,7 +155,9 @@ public class MobAI { @@ -155,7 +155,9 @@ public class MobAI {
public static void AttackBuilding(Mob mob, Building target) {
try {
if(target == null){
return;
}
if (target.getRank() == -1 || !target.isVulnerable() || BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) {
mob.setCombatTarget(null);
return;
@ -202,6 +204,7 @@ public class MobAI { @@ -202,6 +204,7 @@ public class MobAI {
}
} catch (Exception e) {
mob.setCombatTarget(null);
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 { @@ -126,7 +126,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
return false;
// 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) {
boolean override = false;
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) {
@ -152,7 +152,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler { @@ -152,7 +152,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
return false;
}
}
Logger.error("override successful: " + contract.getContractID());
//Logger.error("override successful: " + contract.getContractID());
if (!BuildingManager.addHireling(building, player, zone, contract, contractItem))
return false;

Loading…
Cancel
Save