summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-04-10 02:40:55 -0300
committerpanikon <panikon@zoho.com>2014-04-10 02:40:55 -0300
commit7a5f7db21c5b9f7dc974067312b6b83753a74dbf (patch)
treea534972a497ce350572ec47c1646ebf11d8a63ca /src
parentb5c2a71ef2575b66e7b1b25aed0ad3c60b4fef2b (diff)
downloadhercules-7a5f7db21c5b9f7dc974067312b6b83753a74dbf.tar.gz
hercules-7a5f7db21c5b9f7dc974067312b6b83753a74dbf.tar.bz2
hercules-7a5f7db21c5b9f7dc974067312b6b83753a74dbf.tar.xz
hercules-7a5f7db21c5b9f7dc974067312b6b83753a74dbf.zip
Fixed issue: 8140
http://hercules.ws/board/tracker/issue-8140-toucan-npc-error-message/ That error usually happens when the player clicked on a NPC that has the view id of a mob, to activate this kind of npc it's needed to be in a 2,2 range from it. If the OnTouch area of a npc, coincides with the 2,2 range of another it's expected that the OnTouch event be put first in stack, because unit_walktoxy_timer is executed before any other function in this case. So it's best practice to put an 'end;' before OnTouch events in npcs that have view ids of mobs to avoid this kind of error. Also updated script_commands.txt to add this recomendation.
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 3018cceeb..5f9422e9f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1146,6 +1146,13 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd)
{
nullpo_retr(1, sd);
+ // This usually happens when the player clicked on a NPC that has the view id
+ // of a mob, to activate this kind of npc it's needed to be in a 2,2 range
+ // from it. If the OnTouch area of a npc, coincides with the 2,2 range of
+ // another it's expected that the OnTouch event be put first in stack, because
+ // unit_walktoxy_timer is executed before any other function in this case.
+ // So it's best practice to put an 'end;' before OnTouch events in npcs that
+ // have view ids of mobs to avoid this kind of error [Panikon]
if (sd->npc_id != 0) {
ShowError("npc_click: npc_id != 0\n");
return 1;