View Single Post
  #1  
Old 10-17-2006, 06:09 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Conflicting Object Names

PHP Code:

function onCreated()
  {
  
temp.var = this.ani.getSprite(20);
  if ( 
temp.var == 20 )
    echo( 
temp.var SPC "is an object of type" SPC temp.var.objecttype() );
  } 
returns
PHP Code:
20 is an object of type TGraalVar 
To simplify... Because the obj.name is the sprite name (20), it conflicts with the object type (20) named 20. Instead of returning an TGraalAniSprite, it returns TGraalVar.

This DOES work, however:
PHP Code:
this.ani.getsprite20 ).objecttype(); 
meaning as long as you don't save the object as a variable, you could use it without conflict.
Reply With Quote