diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 9077e9d6ad..4d15f964b0 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -242,7 +242,12 @@ Symbol *Lingo::define(Common::String &name, int nargs, ScriptData *code) { // we don't want to be here. The getHandler call should have used the EntityId and the result // should have been unique! warning("Redefining handler '%s'", name.c_str()); - delete sym->u.defn; + + // Do not attempt to remove code from built-ins + if (sym->type == HANDLER) + delete sym->u.defn; + else + sym->type = HANDLER; } sym->u.defn = code; |