summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-08-20 18:52:41 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-08-20 18:52:41 +0000
commitdb231938e3326a22d90cfb1bc3c3ac6b4bc11728 (patch)
treef5d731dedac64402b0fa71c37f05d8ffadcaab47 /src/map/npc.c
parent0828cd6660ce9bc0e0fae7d6f9af01051937b82b (diff)
downloadhercules-db231938e3326a22d90cfb1bc3c3ac6b4bc11728.tar.gz
hercules-db231938e3326a22d90cfb1bc3c3ac6b4bc11728.tar.bz2
hercules-db231938e3326a22d90cfb1bc3c3ac6b4bc11728.tar.xz
hercules-db231938e3326a22d90cfb1bc3c3ac6b4bc11728.zip
Made it so global events don't get executed in duplicates to prevent unnecessary reprocessing of events that only need to be run once. This potentially reduces the total number of global events by hundreds, even thousands.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14388 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 8db2036a2..bce543dd8 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -282,7 +282,7 @@ int npc_event_doall_sub(DBKey key, void* data, va_list ap)
rid = va_arg(ap, int);
p = strchr(p, ':'); // match only the event name
- if( p && strcmpi(name, p) == 0 )
+ if( p && strcmpi(name, p) == 0 && !ev->nd->src_id ) // Do not run on duplicates. [Paradox924X]
{
if(rid) // a player may only have 1 script running at the same time
npc_event_sub(map_id2sd(rid),ev,key.str);