Change item spawn behaviour
This commit is contained in:
parent
c3abf3a687
commit
a5ad5709c1
1 changed files with 7 additions and 1 deletions
|
@ -25,8 +25,14 @@ object ItemSpawner {
|
|||
}
|
||||
|
||||
fun spawnWeapons() {
|
||||
var itemIterator = spawningItems.shuffled().iterator()
|
||||
|
||||
for (location in getSpawnLocations()) {
|
||||
GameManager.world.dropItem(location, spawningItems.random().itemStack.clone())
|
||||
if (!itemIterator.hasNext()) {
|
||||
itemIterator = spawningItems.shuffled().iterator()
|
||||
}
|
||||
|
||||
GameManager.world.dropItem(location, itemIterator.next().itemStack.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue