Ripple tint change / Minor optimization

This commit is contained in:
Anuken 2023-05-19 11:08:18 -04:00
parent 5db4c67477
commit 39227774e1
3 changed files with 10 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -33,7 +33,7 @@ public class ContentLoader{
public ContentLoader(){
for(ContentType type : ContentType.all){
contentMap[type.ordinal()] = new Seq<>();
contentMap[type.ordinal()] = new Seq<>(type.contentClass == null ? Object.class : type.contentClass);
contentNameMap[type.ordinal()] = new ObjectMap<>();
}
}

View File

@ -1006,15 +1006,20 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
if(proximity.size == 0) return false;
var allItems = content.items();
int itemSize = allItems.size;
Item[] itemArray = allItems.items;
for(int i = 0; i < proximity.size; i++){
Building other = proximity.get((i + dump) % proximity.size);
if(todump == null){
for(int ii = 0; ii < content.items().size; ii++){
Item item = content.item(ii);
for(int ii = 0; ii < itemSize; ii++){
if(!items.has(ii)) continue;
Item item = itemArray[ii];
if(other.team == team && items.has(item) && other.acceptItem(self(), item) && canDump(other, item)){
if(other.acceptItem(self(), item) && canDump(other, item)){
other.handleItem(self(), item);
items.remove(item, 1);
incrementDump(proximity.size);
@ -1022,7 +1027,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
}
}else{
if(other.team == team && other.acceptItem(self(), todump) && canDump(other, todump)){
if(other.acceptItem(self(), todump) && canDump(other, todump)){
other.handleItem(self(), todump);
items.remove(todump, 1);
incrementDump(proximity.size);