forked from SteamWar/SteamWar
Fix TestblockCommand permission check for schematic
This commit is contained in:
+10
-4
@@ -31,6 +31,7 @@ import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.command.TypeMapper;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import de.steamwar.linkage.LinkedInstance;
|
||||
import de.steamwar.sql.BauweltMember;
|
||||
import de.steamwar.sql.Punishment;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
@@ -105,10 +106,6 @@ public class TestblockCommand extends SWCommand {
|
||||
case 12258:
|
||||
if (node == null) {
|
||||
node = region.getRegionData().getTestblockSchematic();
|
||||
if (node != null && !node.accessibleByUser(SteamwarUser.get(bauServer.getOwner()))) {
|
||||
node = null;
|
||||
region.getRegionData().setTestblockSchematic(null);
|
||||
}
|
||||
} else {
|
||||
region.getRegionData().setTestblockSchematic(node);
|
||||
}
|
||||
@@ -117,6 +114,15 @@ public class TestblockCommand extends SWCommand {
|
||||
break;
|
||||
}
|
||||
|
||||
if (node != null && !node.accessibleByUser(SteamwarUser.get(bauServer.getOwner()))) {
|
||||
node = null;
|
||||
region.getRegionData().setTestblockSchematic(null);
|
||||
}
|
||||
if (node != null && BauweltMember.getBauMember(bauServer.getOwnerID(), node.getOwner()) == null) {
|
||||
node = null;
|
||||
region.getRegionData().setTestblockSchematic(null);
|
||||
}
|
||||
|
||||
PasteBuilder.ClipboardProvider clipboardProvider;
|
||||
if (node == null) {
|
||||
clipboardProvider = new PasteBuilder.FileProvider(region.getTestblockArea().getResetFile());
|
||||
|
||||
Reference in New Issue
Block a user