More world processor privileges

This commit is contained in:
Anuken
2022-06-13 21:42:10 -04:00
parent 1be8f11ec8
commit 2134762ed1

View File

@@ -622,7 +622,7 @@ public class LExecutor{
int address = exec.numi(position); int address = exec.numi(position);
Building from = exec.building(target); Building from = exec.building(target);
if(from instanceof MemoryBuild mem && from.team == exec.team){ if(from instanceof MemoryBuild mem && (exec.privileged || from.team == exec.team)){
exec.setnum(output, address < 0 || address >= mem.memory.length ? 0 : mem.memory[address]); exec.setnum(output, address < 0 || address >= mem.memory.length ? 0 : mem.memory[address]);
} }
@@ -646,7 +646,7 @@ public class LExecutor{
int address = exec.numi(position); int address = exec.numi(position);
Building from = exec.building(target); Building from = exec.building(target);
if(from instanceof MemoryBuild mem && from.team == exec.team){ if(from instanceof MemoryBuild mem && (exec.privileged || from.team == exec.team)){
if(address >= 0 && address < mem.memory.length){ if(address >= 0 && address < mem.memory.length){
mem.memory[address] = exec.num(value); mem.memory[address] = exec.num(value);
@@ -733,7 +733,7 @@ public class LExecutor{
int sortDir = exec.bool(sortOrder) ? 1 : -1; int sortDir = exec.bool(sortOrder) ? 1 : -1;
LogicAI ai = null; LogicAI ai = null;
if(base instanceof Ranged r && r.team() == exec.team && if(base instanceof Ranged r && (exec.privileged || r.team() == exec.team) &&
(base instanceof Building || (ai = UnitControlI.checkLogicAI(exec, base)) != null)){ //must be a building or a controllable unit (base instanceof Building || (ai = UnitControlI.checkLogicAI(exec, base)) != null)){ //must be a building or a controllable unit
float range = r.range(); float range = r.range();