attempt to fix boxed combat

This commit is contained in:
2025-03-08 20:07:11 -06:00
parent 96122b5beb
commit 6bac4d830a
3 changed files with 27 additions and 44 deletions
+11 -10
View File
@@ -241,16 +241,6 @@ public enum CombatManager {
if (ac == null)
return;
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
PlayerCharacter pc = (PlayerCharacter)ac;
if(pc.isBoxed){
if(pc.combatTarget != null && pc.combatTarget.getObjectType().equals(GameObjectType.PlayerCharacter)) {
ChatManager.chatSystemInfo(pc, " You Are PvE Flagged: Cannot Attack Players.");
return;
}
}
}
// Attempt to eat null targets until we can clean
// up this unholy mess and refactor it into a thread.
@@ -322,6 +312,7 @@ public enum CombatManager {
if(pet.combatTarget == null && pet.assist)
pet.setCombatTarget(attacker.combatTarget);
}
}
@@ -513,6 +504,16 @@ public enum CombatManager {
}
}
if(abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter)){
PlayerCharacter pc = (PlayerCharacter)abstractCharacter;
if(pc.isBoxed){
if(target.getObjectType().equals(GameObjectType.PlayerCharacter)) {
ChatManager.chatSystemInfo(pc, "You Are PvE Flagged: Cannot Attack Players.");
attackFailure = true;
}
}
}
//TODO Verify attacker has los (if not ranged weapon).
if (!attackFailure) {