diff options
author | Haru <haru@dotalux.com> | 2014-05-16 16:23:47 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-05-16 16:23:47 +0200 |
commit | d350bfeb9cc310ec329d968fc57bf4183b7cb527 (patch) | |
tree | 9fc7cec46f1e4f19cfd8f36483bd106198e23f99 /src/map/pc.h | |
parent | fddd0a68178da57e0416722ee7c003eab7167ac4 (diff) | |
download | hercules-d350bfeb9cc310ec329d968fc57bf4183b7cb527.tar.gz hercules-d350bfeb9cc310ec329d968fc57bf4183b7cb527.tar.bz2 hercules-d350bfeb9cc310ec329d968fc57bf4183b7cb527.tar.xz hercules-d350bfeb9cc310ec329d968fc57bf4183b7cb527.zip |
Changed battle_config definition to extern to avoid mistakes in plugins
- This avoids plugins incorrectly using battle_config (with unreliable
results) instead of using the proper interface, battle->bc.
- Edited various #defines to use battle->bc instead of battle_config so
that they can work perperly in plugins as well.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.h')
-rw-r--r-- | src/map/pc.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/pc.h b/src/map/pc.h index 90f227cee..19e0348d0 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -7,7 +7,7 @@ #include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT -#include "battle.h" // battle_config +#include "battle.h" // battle #include "battleground.h" // enum bg_queue_types #include "buyingstore.h" // struct s_buyingstore #include "itemdb.h" // MAX_ITEMDELAYS @@ -565,7 +565,7 @@ struct map_session_data { #define pc_setsit(sd) ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 2 ) #define pc_isdead(sd) ( (sd)->state.dead_sit == 1 ) #define pc_issit(sd) ( (sd)->vd.dead_sit == 2 ) -#define pc_isidle(sd) ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle_config.idle_no_share ) +#define pc_isidle(sd) ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) #define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) @@ -587,9 +587,9 @@ struct map_session_data { #define pc_isfalcon(sd) ( (sd)->sc.option&OPTION_FALCON ) #define pc_isriding(sd) ( (sd)->sc.option&OPTION_RIDING ) #define pc_isinvisible(sd) ( (sd)->sc.option&OPTION_INVISIBLE ) -#define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle_config.natural_heal_weight_rate ) +#define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle->bc->natural_heal_weight_rate ) #define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 ) -#define pc_maxparameter(sd) ( (((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO || ((sd)->class_&MAPID_UPPERMASK) == MAPID_REBELLION || ((sd)->class_&MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E) ? battle_config.max_extended_parameter : (sd)->class_&JOBL_THIRD ? ((sd)->class_&JOBL_BABY ? battle_config.max_baby_third_parameter : battle_config.max_third_parameter) : ((sd)->class_&JOBL_BABY ? battle_config.max_baby_parameter : battle_config.max_parameter) ) +#define pc_maxparameter(sd) ( (((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO || ((sd)->class_&MAPID_UPPERMASK) == MAPID_REBELLION || ((sd)->class_&MAPID_THIRDMASK) == MAPID_SUPER_NOVICE_E) ? battle->bc->max_extended_parameter : (sd)->class_&JOBL_THIRD ? ((sd)->class_&JOBL_BABY ? battle->bc->max_baby_third_parameter : battle->bc->max_third_parameter) : ((sd)->class_&JOBL_BABY ? battle->bc->max_baby_parameter : battle->bc->max_parameter) ) /** * Ranger **/ |