Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Unexpected object links (https://forums.graalonline.com/forums/showthread.php?t=74382)

Skyld 06-04-2007 09:58 AM

Unexpected object links
 
It seems if you create a new TStaticVar with the name of an existing object, that it becomes a reference to that object from the global scope as opposed to creating a new object in the current scope of that object name. Is this supposed to happen?

NPC "DB_Skyld":
PHP Code:

function onCreated()
{
  
this.flag "Something";

  
temp.obj = new TStaticVar("DB_Skyld");
  echo(
temp.obj.flag);


Produces "Something".

Admins 06-06-2007 06:49 PM

That is supposed to be like that. Giving it a name will make it a global variable, and you cannot just create another object with the same name, it will try to replace the existing object if possible though (if it's just "TGraalVar").
This is partially like that to make it possible to use 'new GuiControl("name")' and such without needing to check if the control is already existing


All times are GMT +2. The time now is 02:14 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.