bug: enemie movement sometimes deref nullptr when calling get_pos()

fixed level gen
This commit is contained in:
2024-07-15 00:23:12 -04:00
parent 6768d73d16
commit 93f68e3969
3 changed files with 6 additions and 2 deletions

View File

@ -122,7 +122,7 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
lvl->get_elist());
auto res = attack((character *)tmp);
if (tmp->is_dead())
if (tmp != nullptr && tmp->is_dead())
tmp->dies(lvl, this);
return res;