v0.9.2: fixed evil eye's drops not working correctly

This commit is contained in:
Evan Debenham 2021-02-11 13:48:06 -05:00
parent 0131feb0b9
commit a6838ace3c

View File

@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.EyeSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
public class Eye extends Mob {
@ -205,12 +206,17 @@ public class Eye extends Mob {
Item loot;
switch(Random.Int(4)){
case 0: case 1: default:
loot = new Dewdrop().quantity(2);
loot = new Dewdrop();
int ofs;
do {
ofs = PathFinder.NEIGHBOURS8[Random.Int(8)];
} while (Dungeon.level.solid[pos + ofs] && !Dungeon.level.passable[pos + ofs]);
Dungeon.level.drop( new Dewdrop(), pos + ofs ).sprite.drop( pos );
break;
case 3:
case 2:
loot = Generator.random(Generator.Category.SEED);
break;
case 4:
case 3:
loot = Generator.random(Generator.Category.STONE);
break;
}