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 05-20-2007, 11:07 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Overriding Functions

Since functions became variables...

if an object joins two classes... The latter class overrides the previous, and not the previous the latter...

class yyy:
PHP Code:
function onCreated()
  {
  
join("xyz");
  }

public function 
zzy()
  {
  return 
xyz::zzy() + 2;
  } 
class xyz:
PHP Code:
public function zzy()
  {
  return 
3;
  } 
returns 3 instead of 5.

( This causes joined classes to behave differently than previous versions... Thus, backward incompatibility )

Last edited by Novo; 05-20-2007 at 11:29 AM..
Reply With Quote
  #2  
Old 05-20-2007, 01:58 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
Ok will check it on monday
Reply With Quote
  #3  
Old 05-21-2007, 10:52 AM
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
Ok fixed, will upload the new version soon.
Reply With Quote
  #4  
Old 05-21-2007, 05:14 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Hrm -- If it is fixed right now... I noticed another error, although I'm not sure if it is connected with this one.

When you update a class and add a new function, the new function, even if it is higher on the class list, will not be the one called.
Reply With Quote
  #5  
Old 05-21-2007, 06:27 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
Normally it should be correct now (you need to restart the npcserver) - each time when a joined class is updated it is relinking the list of functions, starting from the end of the obj.joinedclasses list, and ending with the functions of the object script.
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 12:32 PM.


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