v0.9.1b: fixed various errors with for sale heaps
This commit is contained in:
parent
4e31f7d247
commit
d44dbc04f1
|
@ -83,7 +83,12 @@ public class Shopkeeper extends NPC {
|
|||
for (Heap heap: Dungeon.level.heaps.valueList()) {
|
||||
if (heap.type == Heap.Type.FOR_SALE) {
|
||||
CellEmitter.get( heap.pos ).burst( ElmoParticle.FACTORY, 4 );
|
||||
heap.destroy();
|
||||
if (heap.size() == 1) {
|
||||
heap.destroy();
|
||||
} else {
|
||||
heap.items.remove(heap.size()-1);
|
||||
heap.type = Heap.Type.HEAP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,7 +349,11 @@ public class Heap implements Bundlable {
|
|||
switch(type){
|
||||
case FOR_SALE:
|
||||
Item i = peek();
|
||||
return Messages.get(this, "for_sale", Shopkeeper.sellPrice(i), i.toString());
|
||||
if (size() == 1) {
|
||||
return Messages.get(this, "for_sale", Shopkeeper.sellPrice(i), i.toString());
|
||||
} else {
|
||||
return i.toString();
|
||||
}
|
||||
case CHEST:
|
||||
case MIMIC:
|
||||
return Messages.get(this, "chest");
|
||||
|
|
Loading…
Reference in New Issue
Block a user