Various bugfixes / Fixed persistent inventory, block crashes
This commit is contained in:
@@ -69,11 +69,12 @@ public class BlockInventoryFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void rebuild(boolean actions){
|
||||
|
||||
Player player = input.player;
|
||||
|
||||
IntSet container = new IntSet();
|
||||
|
||||
table.clear();
|
||||
table.clearChildren();
|
||||
table.background("inventory");
|
||||
table.setTouchable(Touchable.enabled);
|
||||
table.update(() -> {
|
||||
@@ -121,7 +122,12 @@ public class BlockInventoryFragment extends Fragment {
|
||||
HandCursorListener l = new HandCursorListener();
|
||||
l.setEnabled(canPick);
|
||||
|
||||
ItemImage image = new ItemImage(item.region, () -> round(tile.entity.items.get(item)));
|
||||
ItemImage image = new ItemImage(item.region, () -> {
|
||||
if(tile == null || tile.entity == null){
|
||||
return "";
|
||||
}
|
||||
return round(tile.entity.items.get(item));
|
||||
});
|
||||
image.addListener(l);
|
||||
|
||||
image.addListener(new InputListener(){
|
||||
|
||||
@@ -84,7 +84,6 @@ public class DebugFragment extends Fragment {
|
||||
FloatingDialog dialog = new FloatingDialog("debug spawn");
|
||||
for(UnitType type : UnitType.all()){
|
||||
dialog.content().addImageButton("white", 40, () -> {
|
||||
dialog.hide();
|
||||
BaseUnit unit = type.create(player.getTeam());
|
||||
unit.inventory.addAmmo(type.weapon.getAmmoType(type.weapon.getAcceptedItems().iterator().next()));
|
||||
unit.setWave();
|
||||
|
||||
Reference in New Issue
Block a user