Typo fixes

This commit is contained in:
Anuken
2022-05-09 19:55:51 -04:00
parent 2b46bbfd2c
commit aa1abeb4be
2 changed files with 4 additions and 17 deletions

View File

@@ -1740,8 +1740,8 @@ lst.unitlocate = Locate a specific type of position/building anywhere on the map
lst.getblock = Get tile data at any location. lst.getblock = Get tile data at any location.
lst.setblock = Set tile data at any location. lst.setblock = Set tile data at any location.
lst.spawnunit = Spawn unit at a location. lst.spawnunit = Spawn unit at a location.
lst.applystatus = Apply or clear a status effect from a uniut. lst.applystatus = Apply or clear a status effect from a unit.
lst.spawnwave = Simulate a wave being spawned at a arbitrary location.\nWill not increment the wave counter. lst.spawnwave = Simulate a wave being spawned at an arbitrary location.\nWill not increment the wave counter.
lst.explosion = Create an explosion at a location. lst.explosion = Create an explosion at a location.
lst.setrate = Set processor execution speed in instructions/tick. lst.setrate = Set processor execution speed in instructions/tick.
lst.fetch = Lookup units, cores, players or buildings by index.\nIndices start at 0 and end at their returned count. lst.fetch = Lookup units, cores, players or buildings by index.\nIndices start at 0 and end at their returned count.

View File

@@ -78,8 +78,6 @@ public class DuctRouter extends Block{
public float progress; public float progress;
public @Nullable Item current; public @Nullable Item current;
protected int acceptors;
@Override @Override
public void draw(){ public void draw(){
Draw.rect(region, x, y); Draw.rect(region, x, y);
@@ -101,7 +99,8 @@ public class DuctRouter extends Block{
var target = target(); var target = target();
if(target != null){ if(target != null){
target.handleItem(this, current); target.handleItem(this, current);
cdump = ((cdump + 1) % acceptors); int mod = sortItem != null && current != sortItem ? 2 : 3;
cdump = ((cdump + 1) % mod);
items.remove(current, 1); items.remove(current, 1);
current = null; current = null;
progress %= (1f - 1f/speed); progress %= (1f - 1f/speed);
@@ -125,18 +124,6 @@ public class DuctRouter extends Block{
public Building target(){ public Building target(){
if(current == null) return null; if(current == null) return null;
acceptors = 0;
//TODO this is horrible.
for(int i = -1; i <= 1; i++){
int dir = Mathf.mod(rotation + i, 4);
if(sortItem != null && (current == sortItem) != (dir == rotation)) continue;
Building other = nearby(dir);
if(other != null && other.team == team && other.acceptItem(this, current)){
acceptors ++;
}
}
for(int i = -1; i <= 1; i++){ for(int i = -1; i <= 1; i++){
int dir = Mathf.mod(rotation + (((i + cdump + 1) % 3) - 1), 4); int dir = Mathf.mod(rotation + (((i + cdump + 1) % 3) - 1), 4);
if(sortItem != null && (current == sortItem) != (dir == rotation)) continue; if(sortItem != null && (current == sortItem) != (dir == rotation)) continue;