mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-25 10:25:42 +07:00
Ripple tint change / Minor optimization
This commit is contained in:
parent
5db4c67477
commit
39227774e1
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.0 KiB |
@ -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<>();
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user