summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-15 00:45:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-15 00:45:28 +0300
commit8ee5eafc741d581579efd696765fb0646b72a553 (patch)
treef2be1be92fc4bf5f16e5b8097dd13aaa0f4c3eec /src/map/map.c
parent45be44cc833bc47991218b90f1bbc1fc6dbd04f4 (diff)
parentd8edfe7eb9e7d86da24c87198f03432b73e72284 (diff)
downloadhercules-8ee5eafc741d581579efd696765fb0646b72a553.tar.gz
hercules-8ee5eafc741d581579efd696765fb0646b72a553.tar.bz2
hercules-8ee5eafc741d581579efd696765fb0646b72a553.tar.xz
hercules-8ee5eafc741d581579efd696765fb0646b72a553.zip
Merge pull request #857 from HerculesWS/scriptqueue
Scriptqueue
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/map.c b/src/map/map.c
index cd2ba17c2..fff1593a4 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1802,16 +1802,16 @@ int map_quit(struct map_session_data *sd) {
skill->cooldown_save(sd);
pc->itemcd_do(sd,false);
- for( i = 0; i < sd->queues_count; i++ ) {
- struct hQueue *queue;
- if( (queue = script->queue(sd->queues[i])) && queue->onLogOut[0] != '\0' ) {
- npc->event(sd, queue->onLogOut, 0);
+ for (i = 0; i < VECTOR_LENGTH(sd->script_queues); i++) {
+ struct script_queue *queue = script->queue(VECTOR_INDEX(sd->script_queues, i));
+ if (queue && queue->event_logout[0] != '\0') {
+ npc->event(sd, queue->event_logout, 0);
}
}
/* two times, the npc event above may assign a new one or delete others */
- for( i = 0; i < sd->queues_count; i++ ) {
- if( sd->queues[i] != -1 )
- script->queue_remove(sd->queues[i],sd->status.account_id);
+ while (VECTOR_LENGTH(sd->script_queues)) {
+ int qid = VECTOR_LAST(sd->script_queues);
+ script->queue_remove(qid, sd->status.account_id);
}
npc->script_event(sd, NPCE_LOGOUT);