From 3dbbab4c3b2cab006e746235dac01220e4c861f2 Mon Sep 17 00:00:00 2001 From: XProger Date: Sun, 1 Jul 2018 21:13:49 +0300 Subject: [PATCH] fix deadloop for giant mutant and multi activation trigger for enemies --- src/controller.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controller.h b/src/controller.h index 71cdb80..aa924c1 100644 --- a/src/controller.h +++ b/src/controller.h @@ -513,7 +513,7 @@ struct Controller { } virtual bool activate() { - if (flags.state == TR::Entity::asActive) + if (flags.state == TR::Entity::asActive || next) return false; flags.invisible = false; flags.state = TR::Entity::asActive; @@ -539,6 +539,7 @@ struct Controller { prev = c; c = c->next; } + next = NULL; } } @@ -546,15 +547,17 @@ struct Controller { Controller *prev = NULL; Controller *c = first; while (c) { + Controller *next = c->next; if (c->flags.state == TR::Entity::asInactive) { if (prev) prev->next = c->next; else first = c->next; c->flags.state = TR::Entity::asNone; + c->next = NULL; } else prev = c; - c = c->next; + c = next; } }