summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-06-25 18:00:28 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-15 11:45:21 -0400
commite0ab38974d08268fd0bbbae16293afb31686c9f8 (patch)
tree0d1801d5f42e47d4a74338c6afc4749b112e8d0c
parente5c60513d5b9c41cdca5ff0c01023d9ef4eb0cfb (diff)
downloadtmwa-e0ab38974d08268fd0bbbae16293afb31686c9f8.tar.gz
tmwa-e0ab38974d08268fd0bbbae16293afb31686c9f8.tar.bz2
tmwa-e0ab38974d08268fd0bbbae16293afb31686c9f8.tar.xz
tmwa-e0ab38974d08268fd0bbbae16293afb31686c9f8.zip
do non-timer events synchronously
-rw-r--r--src/map/npc.cpp2
-rw-r--r--src/map/npc.hpp1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index c4187c1..a40a4ec 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -622,7 +622,7 @@ int npc_event(dumb_ptr<map_session_data> sd, NpcEvent eventname,
&& (sd->bl_y < nd->bl_y - ys / 2 || nd->bl_y + ys / 2 < sd->bl_y))
return 1;
}
- if (sd->npc_id)
+ if (sd->npc_id && sd->npc_pos > -1 && args.size() < 1) // if called from a timer we process async, otherwise sync
{
sd->eventqueuel.push_back(eventname);
return 1;
diff --git a/src/map/npc.hpp b/src/map/npc.hpp
index fa5b6a3..e230ffe 100644
--- a/src/map/npc.hpp
+++ b/src/map/npc.hpp
@@ -45,7 +45,6 @@ constexpr Species INVISIBLE_CLASS = wrap<Species>(32767);
int npc_event_dequeue(dumb_ptr<map_session_data> sd);
int npc_event(dumb_ptr<map_session_data>, NpcEvent, int, Slice<argrec_t>);
-int npc_event(BlockId, NpcEvent, int, Slice<argrec_t>);
inline
int npc_event(dumb_ptr<map_session_data> sd, NpcEvent npcname, int i)
{