diff --git a/src/com/massivecraft/factions/entity/MPlayer.java b/src/com/massivecraft/factions/entity/MPlayer.java index eb67daa6..7b18fd26 100644 --- a/src/com/massivecraft/factions/entity/MPlayer.java +++ b/src/com/massivecraft/factions/entity/MPlayer.java @@ -1,5 +1,6 @@ package com.massivecraft.factions.entity; +import com.massivecraft.factions.Perm; import com.massivecraft.mcore.store.SenderEntity; public class MPlayer extends SenderEntity @@ -44,7 +45,15 @@ public class MPlayer extends SenderEntity public void setMapAutoUpdating(boolean mapAutoUpdating) { this.mapAutoUpdating = mapAutoUpdating; this.changed(); } private boolean usingAdminMode = false; - public boolean isUsingAdminMode() { return this.usingAdminMode; } + public boolean isUsingAdminMode() + { + if (this.usingAdminMode && this.getSender() != null && !Perm.ADMIN.has(this.getSender(), false)) + { + // If we are using admin mode but don't have permissions for it we deactivate it. + this.setUsingAdminMode(false); + } + return this.usingAdminMode; + } public void setUsingAdminMode(boolean usingAdminMode) { this.usingAdminMode = usingAdminMode; this.changed(); } }