v2.2.0: fixed corpse dust wraiths never spawning at low hero viewdist
This commit is contained in:
@@ -118,11 +118,14 @@ public class CorpseDust extends Item {
|
||||
int powerNeeded = Math.min(49, wraiths*wraiths);
|
||||
if (powerNeeded <= spawnPower){
|
||||
ArrayList<Integer> candidates = new ArrayList<>();
|
||||
//min distance scales based on hero's view distance
|
||||
// wraiths must spawn at least 4/3/2/1 tiles away at view distance of 8(default)/7/4/1
|
||||
int minDist = Math.round(Dungeon.hero.viewDistance/3f);
|
||||
for (int i = 0; i < Dungeon.level.length(); i++){
|
||||
if (Dungeon.level.heroFOV[i]
|
||||
&& !Dungeon.level.solid[i]
|
||||
&& Actor.findChar( i ) == null
|
||||
&& Dungeon.level.distance(i, Dungeon.hero.pos) > 3){
|
||||
&& Dungeon.level.distance(i, Dungeon.hero.pos) > minDist){
|
||||
candidates.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user