Implemented various suggestions

- Pathfinding weighs walls more
- C disables all HUD
- Unloader doesn't store items
- Some bugfixes
This commit is contained in:
Anuken
2020-05-07 21:37:41 -04:00
parent 2ca7f553bb
commit 2b9d618bd2
16 changed files with 78 additions and 54 deletions
+21 -1
View File
@@ -477,7 +477,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
* Tries to put this item into a nearby container, if there are no available
* containers, it gets added to the block's inventory.
*/
public void offloadNear(Item item){
public void offload(Item item){
Array<Tilec> proximity = proximity();
int dump = rotation() / block.dumpIncrement;
useContent(item);
@@ -494,6 +494,26 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
handleItem(this, item);
}
/**
* 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){
Array<Tilec> proximity = proximity();
int dump = rotation() / block.dumpIncrement;
useContent(item);
for(int i = 0; i < proximity.size; i++){
incrementDump(proximity.size);
Tilec other = proximity.get((i + dump) % proximity.size);
if(other.team() == team() && other.acceptItem(this, item) && canDump(other, item)){
other.handleItem(this, item);
return true;
}
}
return false;
}
/** Try dumping any item near the */
public boolean dump(){
return dump(null);