Removed redundant team checks

This commit is contained in:
Anuken
2023-05-19 11:12:32 -04:00
parent cee09dd167
commit 4a53a80b21

View File

@ -775,7 +775,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
for(int i = 0; i < proximity.size; i++){
Building other = proximity.get((i + dump) % proximity.size);
if(other.team == team && other.acceptPayload(self(), todump)){
if(other.acceptPayload(self(), todump)){
other.handlePayload(self(), todump);
incrementDump(proximity.size);
return true;
@ -828,7 +828,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
other = other.getLiquidDestination(self(), liquid);
if(other != null && other.team == team && other.block.hasLiquids && canDumpLiquid(other, liquid) && other.liquids != null){
if(other != null && other.block.hasLiquids && canDumpLiquid(other, liquid) && other.liquids != null){
float ofract = other.liquids.get(liquid) / other.block.liquidCapacity;
float fract = liquids.get(liquid) / block.liquidCapacity;
@ -935,7 +935,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
for(int i = 0; i < proximity.size; i++){
incrementDump(proximity.size);
Building other = proximity.get((i + dump) % proximity.size);
if(other.team == team && other.acceptItem(self(), item) && canDump(other, item)){
if(other.acceptItem(self(), item) && canDump(other, item)){
other.handleItem(self(), item);
return;
}
@ -953,7 +953,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
for(int i = 0; i < proximity.size; i++){
incrementDump(proximity.size);
Building other = proximity.get((i + dump) % proximity.size);
if(other.team == team && other.acceptItem(self(), item) && canDump(other, item)){
if(other.acceptItem(self(), item) && canDump(other, item)){
other.handleItem(self(), item);
return true;
}
@ -1694,7 +1694,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
for(Point2 point : nearby){
Building other = world.build(tile.x + point.x, tile.y + point.y);
if(other == null || !(other.tile.interactable(team))) continue;
if(other == null || other.team != team) continue;
other.proximity.addUnique(self());