summon fix

This commit is contained in:
2024-04-20 10:49:52 -05:00
parent 1f7ea89d66
commit e2cca6201f
+2 -3
View File
@@ -1298,8 +1298,7 @@ public enum PowersManager {
if (pc == null)
return;
PlayerCharacter target = SessionManager
.getPlayerCharacterByLowerCaseName(msg.getTargetName());
PlayerCharacter target = SessionManager.getPlayerCharacterByLowerCaseName(msg.getTargetName());
if (target == null || target.equals(pc) || target.isCombat() || target.getGuild().getNation().equals(pc.getGuild().getNation()) == false) {
if (target == null) // Player not found. Send not found message
@@ -1309,7 +1308,7 @@ public enum PowersManager {
ChatManager.chatInfoError(pc,
"Cannot summon player in combat.");
// else trying to summon self, just fail
if(target.getGuild().getNation().equals(pc.getGuild().getNation()) == false){
if(target != null && target.getGuild().getNation().equals(pc.getGuild().getNation()) == false){
ChatManager.chatInfoError(pc,
"Cannot summon outside of nation.");
}