Issue information

Issue ID
#8226
Status
Fixed
Severity
Fair
Started
jaBote
Jun 6, 2014 10:34
Last Post
jaBote
Jun 7, 2014 19:11
Confirmation
N/A

jaBote - Jun 6, 2014 10:34

As I said on [url="http://herc.ws/board/topic/3745-pk-in-a-specific-location-x-y/?p=37104"]http://herc.ws/board/topic/3745-pk-in-a-specific-location-x-y/?p=37104[/url]

conflicting line of code:
[code=auto:0]else addtimercount 1000, strnpcinfo(3)+"::OnKillable"; // Will check again after a second until player goes out of the square[/code]

The scripting warning it yields:
[img]http://i62.tinypic.com/2vv3qs7.jpg[/img]

[url=https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L6158]What documentation says[/url]:
[quote]

addtimercount <ticks>,"NPC::OnLabel";[/quote]

What the code says:
[code=auto:0]BUILDIN(addtimercount) { const char *event; int tick; TBL_PC* sd; event=script_getstr(st, 2); tick=script_getnum(st,3); sd = script->rid2sd(st); if( sd == NULL ) return true; script->check_event(st, event); pc->addeventtimercount(sd,event,tick); return true; }[/code]

This is a serious documentation issue, this is why I haven't changed it right away.

How should it be made? Fix the doc to reflect the source or fix the source to reflect the other script commands (and the doc's) behavior?

pan - Jun 6, 2014 18:34

In this case the documentation should reflect the behaviour depicted in our code, you can commit this change to our script_commands.txt if you want.

jaBote - Jun 7, 2014 19:11

Fixed in [url="https://github.com/HerculesWS/Hercules/commit/60e367824750a3e2498a78b3d78367c0b8a499de"]https://github.com/HerculesWS/Hercules/commit/60e367824750a3e2498a78b3d78367c0b8a499de[/url]

I'd like to give a small shoutout both for the documentation makers and the scripters who have been using this script command because this serious documentation error has been there for as far as I've been able to track this file ([url="https://code.google.com/p/eathena-project/source/browse/branches/stable/doc/script_commands.txt?spec=svn2397&r=2397#1681)"]eAthena SVN r2397[/url]) and its precursor ([url="https://code.google.com/p/eathena-project/source/browse/branches/stable/doc/Script_Commands.txt?r=1891"]eAthena SVN r1891: doc/Script_Commands.txt[/url], since May 30, 2005) when the source required it has always been wanting it on that order ([url="https://code.google.com/p/eathena-project/source/browse/branches/stable/src/map/script.c?r=1891#3982"]proof[/url]). Its precursor on the same revision (eAthena [url="https://code.google.com/p/eathena-project/source/browse/branches/stable/doc/script_ref.txt?r=1891"]SVN r1891: doc/script_ref.txt[/url]) had it on the right order since eAthena SVN r1 ([url="https://code.google.com/p/eathena-project/source/browse/doc/script_ref.txt?spec=svn1&r=1"]proof[/url], and [url="https://code.google.com/p/eathena-project/source/browse/src/map/script.c?r=1#3747"]src/map/script.c at that time[/url]) .

I'm sure we all at Hercules and all predecessors until eAthena r1891 are very grateful that we have this documentation, and it isn't just a documentation maker mistake (since we can always make mistakes) but it's not a mistake but a fault for every scripter that has used that script command and received the server side warning (if it had) for inappropriate arguments order since then and haven't reported it or just fixed it for themselves because I refuse to believe that this script command (of moderate usefulness) hasn't been used by anybody in more than 9 years.

This post has been edited by jaBote on Jun 7, 2014 19:21