Weirdness: getSkillTotal versus getCappedSkillTotal
Posted: Fri Dec 18, 2009 12:03 pm
Today I discovered something weird with the Command List that defines what functions are available to the scripts.
There are 2 functions, getSkillTotal and getCappedSkillTotal, both of them will execute the same internal function and thus are equal even though the name suggests different return values.
The definition in the Command List table/array looks like this:
Both functions will be executed by the function I named COMMAND_getSkillTotal. When I was looking at that function I noticed that the core also has an internal function COMMAND_getCappedSkillTotal. The string reference to "getCappedSkillTotal" indicates that such an internal function really exists.
As you can see in the above screenshot, a "DATA XREF" comment is missing for COMMAND_getCappedSkillTotal showing that this function is unreferenced which means unused!
Because no script is using "getCappedSkillTotal" I'm thinking this was done on purpose and it is a left-over from older server code. For the record, only two scripts are calling "getSkillTotal": "info.m" and "repconvert.m".
There are 2 functions, getSkillTotal and getCappedSkillTotal, both of them will execute the same internal function and thus are equal even though the name suggests different return values.
The definition in the Command List table/array looks like this:
- definition.jpg (22.58 KiB) Viewed 3242 times
Both functions will be executed by the function I named COMMAND_getSkillTotal. When I was looking at that function I noticed that the core also has an internal function COMMAND_getCappedSkillTotal. The string reference to "getCappedSkillTotal" indicates that such an internal function really exists.
- 2 functions.jpg (118.96 KiB) Viewed 3242 times
As you can see in the above screenshot, a "DATA XREF" comment is missing for COMMAND_getCappedSkillTotal showing that this function is unreferenced which means unused!
Because no script is using "getCappedSkillTotal" I'm thinking this was done on purpose and it is a left-over from older server code. For the record, only two scripts are calling "getSkillTotal": "info.m" and "repconvert.m".