v1.0.3: fixed rare vfx issues with guards and pushing effects

This commit is contained in:
Evan Debenham 2021-08-30 22:29:37 -04:00
parent 724ffbb85b
commit 8b1013fd7e
2 changed files with 6 additions and 2 deletions

View File

@ -116,6 +116,7 @@ public class Guard extends Mob {
private void pullEnemy( Char enemy, int pullPos ){ private void pullEnemy( Char enemy, int pullPos ){
enemy.pos = pullPos; enemy.pos = pullPos;
enemy.sprite.place(pullPos);
Dungeon.level.occupyCell(enemy); Dungeon.level.occupyCell(enemy);
Cripple.prolong(enemy, Cripple.class, 4f); Cripple.prolong(enemy, Cripple.class, 4f);
if (enemy == Dungeon.hero) { if (enemy == Dungeon.hero) {
@ -173,7 +174,7 @@ public class Guard extends Mob {
&& !isCharmedBy( enemy ) && !isCharmedBy( enemy )
&& !canAttack( enemy ) && !canAttack( enemy )
&& Dungeon.level.distance( pos, enemy.pos ) < 5 && Dungeon.level.distance( pos, enemy.pos ) < 5
&& Random.Int(3) == 0
&& chain(enemy.pos)){ && chain(enemy.pos)){
return !(sprite.visible || enemy.sprite.visible); return !(sprite.visible || enemy.sprite.visible);

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.effects; package com.shatteredpixel.shatteredpixeldungeon.effects;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -58,7 +59,9 @@ public class Pushing extends Actor {
@Override @Override
protected boolean act() { protected boolean act() {
if (sprite != null) { if (sprite != null) {
if (Dungeon.level.heroFOV[from] || Dungeon.level.heroFOV[to]){
sprite.visible = true;
}
if (effect == null) { if (effect == null) {
new Effect(); new Effect();
} }