mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
If you name a torque script object the same name as a Torque script class, you will get heap corruption with no warning at all. Changed original fix to cause a script error and reject object creation, instead of just renaming the object and moving along.
This commit is contained in:
parent
c75d6feb20
commit
21ff1e26bb
|
|
@ -650,6 +650,15 @@ breakContinue:
|
|||
// IF we aren't looking at a local/internal object, then check if
|
||||
// this object already exists in the global space
|
||||
|
||||
AbstractClassRep* rep = AbstractClassRep::findClassRep( objectName );
|
||||
if (rep != NULL) {
|
||||
Con::errorf(ConsoleLogEntry::General, "%s: Cannot name object %s the same name as a script class.",
|
||||
getFileLine(ip), objectName);
|
||||
ip = failJump;
|
||||
STR.popFrame();
|
||||
break;
|
||||
}
|
||||
|
||||
SimObject *obj = Sim::findObject( objectName );
|
||||
if (obj /*&& !obj->isLocalName()*/)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue