v0.2.3e: Improved shop generation logic, fixes bugs and allows for much larger shops without error.
This commit is contained in:
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.ShopPainter;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Graph;
|
||||
import com.watabou.utils.Random;
|
||||
@@ -123,7 +124,7 @@ public abstract class RegularLevel extends Level {
|
||||
if (Dungeon.shopOnLevel()) {
|
||||
Room shop = null;
|
||||
for (Room r : roomEntrance.connected.keySet()) {
|
||||
if (r.connected.size() == 1 && r.width() >= 5 && r.height() >= 5) {
|
||||
if (r.connected.size() == 1 && ((r.width()-1)*(r.height()-1) >= ShopPainter.spaceNeeded())) {
|
||||
shop = r;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user