1
0
Fork 0

Change item spawn behaviour

This commit is contained in:
Moritz Ruth 2020-06-09 00:46:06 +02:00
parent c3abf3a687
commit a5ad5709c1
No known key found for this signature in database
GPG key ID: AFD57E23E753841B

View file

@ -25,8 +25,14 @@ object ItemSpawner {
} }
fun spawnWeapons() { fun spawnWeapons() {
var itemIterator = spawningItems.shuffled().iterator()
for (location in getSpawnLocations()) { 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())
} }
} }