Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Overriding Functions (https://forums.graalonline.com/forums/showthread.php?t=74082)

Novo 05-20-2007 11:07 AM

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 )

Admins 05-20-2007 01:58 PM

Ok will check it on monday

Admins 05-21-2007 10:52 AM

Ok fixed, will upload the new version soon.

Novo 05-21-2007 05:14 PM

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.

Admins 05-21-2007 06:27 PM

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.


All times are GMT +2. The time now is 10:55 AM.

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