v0.9.3: fixed golems crashing the game if a character is on top of them.

This commit is contained in:
Evan Debenham 2021-05-07 13:42:43 -04:00
parent 989afd404a
commit a491980067

View File

@ -201,7 +201,7 @@ public class Golem extends Mob {
int oldPos = pos;
if (enemyTeleCooldown <= 0 && Random.Int(100/distance(enemy)) == 0
if (enemyTeleCooldown <= 0 && distance(enemy) >= 1 && Random.Int(100/distance(enemy)) == 0
&& !Char.hasProp(enemy, Property.IMMOVABLE)){
if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.zap( enemy.pos );