Removed redundant team checks
This commit is contained in:
@@ -775,7 +775,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
for(int i = 0; i < proximity.size; i++){
|
for(int i = 0; i < proximity.size; i++){
|
||||||
Building other = proximity.get((i + dump) % proximity.size);
|
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);
|
other.handlePayload(self(), todump);
|
||||||
incrementDump(proximity.size);
|
incrementDump(proximity.size);
|
||||||
return true;
|
return true;
|
||||||
@@ -828,7 +828,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
other = other.getLiquidDestination(self(), liquid);
|
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 ofract = other.liquids.get(liquid) / other.block.liquidCapacity;
|
||||||
float fract = liquids.get(liquid) / 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++){
|
for(int i = 0; i < proximity.size; i++){
|
||||||
incrementDump(proximity.size);
|
incrementDump(proximity.size);
|
||||||
Building other = proximity.get((i + dump) % 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);
|
other.handleItem(self(), item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -953,7 +953,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
for(int i = 0; i < proximity.size; i++){
|
for(int i = 0; i < proximity.size; i++){
|
||||||
incrementDump(proximity.size);
|
incrementDump(proximity.size);
|
||||||
Building other = proximity.get((i + dump) % 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);
|
other.handleItem(self(), item);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1694,7 +1694,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
for(Point2 point : nearby){
|
for(Point2 point : nearby){
|
||||||
Building other = world.build(tile.x + point.x, tile.y + point.y);
|
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());
|
other.proximity.addUnique(self());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user