Fixed #2866
This commit is contained in:
@@ -15,7 +15,7 @@ public class CircleFormation extends FormationPattern{
|
||||
float radius = spacing / (float)Math.sin(180f / slots * Mathf.degRad);
|
||||
outLocation.set(Angles.trnsx(angle, radius), Angles.trnsy(angle, radius), angle);
|
||||
}else{
|
||||
outLocation.set(0, 0, 360f * slotNumber);
|
||||
outLocation.set(0, spacing * 1.1f, 360f * slotNumber);
|
||||
}
|
||||
|
||||
outLocation.z += angleOffset;
|
||||
|
||||
@@ -1527,9 +1527,9 @@ public class Blocks implements ContentList{
|
||||
|
||||
hasPower = true;
|
||||
size = 2;
|
||||
force = 4.5f;
|
||||
force = 5f;
|
||||
scaledForce = 5.5f;
|
||||
range = 110f;
|
||||
range = 160f;
|
||||
damage = 0.4f;
|
||||
health = 160 * size * size;
|
||||
rotateSpeed = 10;
|
||||
|
||||
@@ -53,7 +53,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
transient Block block;
|
||||
transient Seq<Building> proximity = new Seq<>(8);
|
||||
transient boolean updateFlow;
|
||||
transient byte dump;
|
||||
transient byte cdump;
|
||||
transient int rotation;
|
||||
transient boolean enabled = true;
|
||||
transient float enabledControlTime;
|
||||
@@ -443,7 +443,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
public boolean dumpPayload(Payload todump){
|
||||
if(proximity.size == 0) return false;
|
||||
|
||||
int dump = this.dump;
|
||||
int dump = this.cdump;
|
||||
|
||||
for(int i = 0; i < proximity.size; i++){
|
||||
Building other = proximity.get((i + dump) % proximity.size);
|
||||
@@ -477,7 +477,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
|
||||
public void dumpLiquid(Liquid liquid){
|
||||
int dump = this.dump;
|
||||
int dump = this.cdump;
|
||||
|
||||
for(int i = 0; i < proximity.size; i++){
|
||||
incrementDump(proximity.size);
|
||||
@@ -577,7 +577,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
* containers, it gets added to the block's inventory.
|
||||
*/
|
||||
public void offload(Item item){
|
||||
int dump = this.dump;
|
||||
int dump = this.cdump;
|
||||
|
||||
for(int i = 0; i < proximity.size; i++){
|
||||
incrementDump(proximity.size);
|
||||
@@ -595,7 +595,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
* Tries to put this item into a nearby container. Returns success. Unlike #offload(), this method does not change the block inventory.
|
||||
*/
|
||||
public boolean put(Item item){
|
||||
int dump = this.dump;
|
||||
int dump = this.cdump;
|
||||
|
||||
for(int i = 0; i < proximity.size; i++){
|
||||
incrementDump(proximity.size);
|
||||
@@ -621,7 +621,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
public boolean dump(Item todump){
|
||||
if(!block.hasItems || items.total() == 0 || (todump != null && !items.has(todump))) return false;
|
||||
|
||||
int dump = this.dump;
|
||||
int dump = this.cdump;
|
||||
|
||||
if(proximity.size == 0) return false;
|
||||
|
||||
@@ -656,7 +656,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
|
||||
public void incrementDump(int prox){
|
||||
dump = (byte)((dump + 1) % prox);
|
||||
cdump = (byte)((cdump + 1) % prox);
|
||||
}
|
||||
|
||||
/** Used for dumping items. */
|
||||
|
||||
@@ -188,6 +188,11 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
||||
if(unit.isRemote()){
|
||||
unit.snapInterpolation();
|
||||
}
|
||||
|
||||
//reset selected block when switching units
|
||||
if(!headless && isLocal()){
|
||||
control.input.block = null;
|
||||
}
|
||||
}
|
||||
|
||||
Events.fire(new UnitChangeEvent(self(), unit));
|
||||
|
||||
Reference in New Issue
Block a user