From e2fd7351bd814a778974732504888652463106b8 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 16 Apr 2026 19:14:53 +0200 Subject: [PATCH] shmup:: fixup --- shmup.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/shmup.cpp b/shmup.cpp index 5c3dbcdf..7b66464b 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -89,12 +89,7 @@ struct monster : cell_content, dim_listener { void rebasePat(const shiftmatrix& new_pat, cell *tgt); - ~monster() { - if(mousetarget == this) mousetarget = nullptr; - if(lmousetarget == this) lmousetarget = nullptr; - callhooks(hooks_destroy_monster, this); - if(parent) parent->unref(); - } + ~monster(); void set_parent(monster *par) { if(parent) parent->unref(); @@ -130,6 +125,14 @@ EX cell_content_list active; EX vector nonvirtual, additional; +monster::~monster() { + if(mousetarget == this) mousetarget = nullptr; + if(lmousetarget == this) lmousetarget = nullptr; + callhooks(hooks_destroy_monster, this); + if(parent) parent->unref(); + nonvirtual.erase(std::remove(nonvirtual.begin(), nonvirtual.end(), this), nonvirtual.end()); + } + cell *findbaseAround(shiftpoint p, cell *around, int maxsteps) { if(quotient || fake::split()) {