Minor bugfixes

This commit is contained in:
Anuken 2021-06-09 08:37:26 -04:00
parent 1895c7b8e0
commit 7dcfd648f7
2 changed files with 19 additions and 12 deletions

View File

@ -131,22 +131,24 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
@Remote(called = Loc.both, targets = Loc.both, forward = true, unreliable = true)
public static void deletePlans(Player player, int[] positions){
if(netServer.admins.allowAction(player, ActionType.removePlanned, a -> a.plans = positions)){
if(net.server() && !netServer.admins.allowAction(player, ActionType.removePlanned, a -> a.plans = positions)){
throw new ValidateException(player, "Player cannot remove plans.");
}
var it = player.team().data().blocks.iterator();
//O(n^2) search here; no way around it
outer:
while(it.hasNext()){
BlockPlan req = it.next();
if(player == null) return;
for(int pos : positions){
if(req.x == Point2.x(pos) && req.y == Point2.y(pos)){
it.remove();
continue outer;
}
var it = player.team().data().blocks.iterator();
//O(n^2) search here; no way around it
outer:
while(it.hasNext()){
BlockPlan req = it.next();
for(int pos : positions){
if(req.x == Point2.x(pos) && req.y == Point2.y(pos)){
it.remove();
continue outer;
}
}
}
}

View File

@ -16,6 +16,11 @@ public class BlockUnloader extends BlockLoader{
return true;
}
@Override
public boolean rotatedOutput(int x, int y){
return false;
}
public class BlockUnloaderBuild extends BlockLoaderBuild{
@Override