From 367c806bccbf242c2025356777b4cf1d194c481a Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 14 Nov 2015 19:43:38 +0100 Subject: Standardized script-queue related commands - The commands queueadd, queueremove, queueopt, queuedel and qiclear now all return true (success) or false (failure). - Taken/extended from AnnieRuru's PR #847. - The constants HQO_OnDeath, HQO_OnLogOut, HQO_OnMapChange were renamed to QUEUEOPT_DEATH, QUEUEOPT_LOGOUT, QUEUEOPT_MAPCHANGE respectively. - The name of the variable @QMapChangeTo$ used during the QUEUEOPT_MAPCHANGE event has been renamed to @Queue_Destination_Map$. Signed-off-by: Haru --- db/const.txt | 6 +++--- doc/script_commands.txt | 40 ++++++++++++++++++++++++---------------- npc/custom/bgqueue/flavius.txt | 8 ++++---- src/map/pc.c | 2 +- src/map/script.c | 41 +++++++++++++++++++++-------------------- 5 files changed, 53 insertions(+), 44 deletions(-) diff --git a/db/const.txt b/db/const.txt index ca78c223d..7b0b7c076 100644 --- a/db/const.txt +++ b/db/const.txt @@ -3356,9 +3356,9 @@ IT_AMMO 10 IT_DELAYCONSUME 11 IT_CASH 18 -HQO_OnLogout 1 -HQO_OnDeath 2 -HQO_OnMapChange 3 +QUEUEOPT_LOGOUT 1 +QUEUEOPT_DEATH 2 +QUEUEOPT_MAPCHANGE 3 IOT_NONE 0 IOT_CHAR 1 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 6e2b92417..5219eed47 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -8964,17 +8964,21 @@ Returns the amount of entries in the queue instance of . --------------------------------------- -*queueadd(,); +*queueadd(, ); -Adds to queue of , returning 1 if is already -present in the queue, otherwise returning 0. +Adds to queue of . + +Returns false if couldn't be added (was already present in the queue), +true otherwise. --------------------------------------- -*queueremove(,); +*queueremove(, ); + +Removes from queue of . -Removes from queue of , returning 1 if is not -present in the queue, otherwise returning 0. +Returns false if couldn't be removed (wasn't present in the queue), +true otherwise. --------------------------------------- @@ -8984,23 +8988,26 @@ Modifies 's . When