Browse Source

Simplify buffer check when adding a registered variable

James Urquhart 10 years ago
parent
commit
e5c28b4d7f
1 changed files with 1 additions and 2 deletions
  1. 1 2
      Engine/source/console/consoleInternal.cpp

+ 1 - 2
Engine/source/console/consoleInternal.cpp

@@ -693,8 +693,7 @@ Dictionary::Entry* Dictionary::addVariable(  const char *name,
    Entry *ent = add(StringTable->insert(name));
    
    if (  ent->value.type <= ConsoleValue::TypeInternalString &&
-         ent->value.sval != typeValueEmpty && 
-         ent->value.type != ConsoleValue::TypeInternalStackString && ent->value.type != ConsoleValue::TypeInternalStringStackPtr )
+         ent->value.bufferLen > 0 )
       dFree(ent->value.sval);
 
    ent->value.type = type;