From 33d37ff161f724b0bbcde4eedf32c528d3576c90 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 27 Feb 2016 05:20:40 +0100 Subject: Corrected wrong variable type of struct status_change_data::tick - The variable should be signed, since it uses the value -1 to indicate infinite duration (and it's stored as signed in the database). - Added #define for the special value -1 (INFINITE_DURATION). - This fixes an issue causing status changes to fail being saved to database (thanks to Michi for reporting it). - Related to commit 8dc75721. Signed-off-by: Haru --- src/common/mmo.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/mmo.h b/src/common/mmo.h index 981c1b30b..91eccb8cd 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -220,6 +220,8 @@ #define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable +#define INFINITE_DURATION (-1) // Infinite duration for status changes + struct hplugin_data_store; enum item_types { @@ -392,11 +394,11 @@ struct script_reg_str { char *value; }; -// For saving status changes across sessions. [Skotlex] +/// For saving status changes across sessions. [Skotlex] struct status_change_data { - unsigned short type; //SC_type - int val1, val2, val3, val4; - unsigned int tick; //Remaining duration. + unsigned short type; ///< Status change type (@see enum sc_type) + int val1, val2, val3, val4; ///< Parameters (meaning depends on type). + int tick; ///< Remaining duration. }; struct storage_data { -- cgit v1.2.3-60-g2f50