summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-03 03:30:57 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-03 03:30:57 +0000
commit0c5b0d92695599474b377c1c5c743682498b5786 (patch)
treef98247e2237e72d78b521c7e49591b4bd0190b78 /src/map
parentdbbe1b3a5621aa982ec6f068807558f1722f1f6b (diff)
downloadhercules-0c5b0d92695599474b377c1c5c743682498b5786.tar.gz
hercules-0c5b0d92695599474b377c1c5c743682498b5786.tar.bz2
hercules-0c5b0d92695599474b377c1c5c743682498b5786.tar.xz
hercules-0c5b0d92695599474b377c1c5c743682498b5786.zip
Modified script function 'donpcevent' as requested by Script Developer Euphy,
- now returns 1 when successful, 0 when fails. - now shows a debug message on the console when no events are triggered. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16564 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index dfa8c14ce..7d0d9df74 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -8601,7 +8601,12 @@ BUILDIN_FUNC(donpcevent)
{
const char* event = script_getstr(st,2);
check_event(st, event);
- npc_event_do(event);
+ if( !npc_event_do(event) ) {
+ struct npc_data * nd = map_id2nd(st->oid);
+ ShowDebug("NPCEvent '%s' not found! (source: %s)\n",event,nd?nd->name:"Unknown");
+ script_pushint(st, 0);
+ } else
+ script_pushint(st, 1);
return 0;
}