Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-23-2006, 11:13 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
The No-Where Variable!

PHP Code:
//#CLIENTSIDE
function onCreated()
  {
  
player.tv = {1,2,3};
  
this.var = new TStaticVar();
  echo( 
this.var.tv ); // returns 1,2,3
  
echo( this.var.tv.size() ); // returns 0
  
echo( this.var.tv ); // returns 0
  

=]
Reply With Quote
  #2  
Old 12-07-2006, 01:13 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Strange problem.
I would say it's not finding this.var.tv and then wrongly getting another tv var. Once you call tv.size() it is creating this.var.tv and everything is fine.
When you have a variable name without leading ("tv") then it is also checking for player.tv on clientside, for compatibility with old scripts since setstring tv,123; is actually setting player.tv. In this case it should not check for "tv" since it is this.var.tv, will try to fix that.

Update: ok fixed this in my Graal version and in the npcserver, so with the next release of those the bug should be fixed. Thanks for reporting it, it can probably be a quite big problem in some cases.

Last edited by Admins; 12-07-2006 at 03:47 PM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:49 PM.


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