shmup:: fixup

This commit is contained in:
Zeno Rogue
2026-04-16 19:14:53 +02:00
parent f6ef61be2e
commit e2fd7351bd
+9 -6
View File
@@ -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<monster*> 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()) {