forked from MagicBane/Server
attempt to fix boxed combat
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user