From fc07e616362692b01d745be46fc05683ea767b99 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Wed, 18 Feb 2009 20:00:12 +0000 Subject: [PATCH] defuse triggerhappy alias context cleanup git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4170 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/command.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 0ce1fd0f..44f5b3ad 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -943,13 +943,14 @@ int popscontext() if(execcontext < old && old >= IEXC_MAPCFG) // clean up aliases created in the old (map cfg) context { + int limitcontext = max(execcontext + 1, (int) IEXC_MAPCFG); // don't clean up below IEXC_MAPCFG enumeratekt(*idents, const char *, name, ident, id, { - if(id.type == ID_ALIAS && id.context > execcontext) + if(id.type == ID_ALIAS && id.context >= limitcontext) { - while(id.stack && id.stack->context > execcontext) + while(id.stack && id.stack->context >= limitcontext) popident(id); - if(id.context > execcontext) + if(id.context >= limitcontext) { if(id.action != id.executing) delete[] id.action; idents->remove(name);