Prevent tiles with chests from falling.

This commit is contained in:
Linus Probert 2018-10-15 13:26:17 +02:00
parent fd8799f36b
commit 6e6f28dd8e
3 changed files with 6 additions and 3 deletions

View File

@ -586,7 +586,7 @@ monster_update(Monster *m, UpdateData *data)
sprite_update(m->sprite, data);
if (m->sprite->state == SPRITE_STATE_FALLING && m->sprite->dim.width < 4) {
if (m->sprite->hidden == SPRITE_STATE_FALLING && m->sprite->hidden) {
m->stats.hp = 0;
player_monster_kill_check(data->player, m);
return;

View File

@ -300,7 +300,8 @@ move(Player *player, RoomMatrix *matrix, Vector2d direction)
lastPos.y < 10 &&
lastSpace->decoration == NULL &&
lastSpace->trap == NULL &&
lastSpace->objects == NULL
lastSpace->objects == NULL &&
lastSpace->items == NULL
)
map_trigger_tile_fall(lastSpace->tile);
}

View File

@ -136,8 +136,10 @@ sprite_update(Sprite *s, UpdateData *data)
s->dim.height /2
};
}
if (s->dim.width < 4)
if (s->dim.width < 4) {
s->hidden = true;
s->state = SPRITE_STATE_DEFAULT;
}
}
}