Bugfix: Load all icons for monsters spawned on maps, even when they're not part of the list of monsters that may spawn on maps

This commit is contained in:
Oskar Wiksten
2013-07-23 13:45:02 +02:00
parent 3523d0105c
commit a54d0fd6e8

View File

@@ -104,10 +104,16 @@ public final class TileManager {
public HashSet<Integer> getTileIDsFor(PredefinedMap map, LayeredTileMap tileMap, WorldContext world) {
HashSet<Integer> iconIDs = new HashSet<Integer>();
for(MonsterSpawnArea a : map.spawnAreas) {
for(String monsterTypeID : a.monsterTypeIDs) {
for (MonsterSpawnArea a : map.spawnAreas) {
for (String monsterTypeID : a.monsterTypeIDs) {
iconIDs.add(world.monsterTypes.getMonsterType(monsterTypeID).iconID);
}
// Add icons for monsters that are already spawned, but that do not belong to the group of
// monsters that usually spawn here. This could happen if we change the contents of spawn-
// areas in a later release,
for (Monster m : a.monsters) {
iconIDs.add(m.iconID);
}
}
iconIDs.addAll(tileMap.usedTileIDs);
return iconIDs;