From 2b092c150e1226decc48160316070fc44d5fbba0 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 20 Dec 2012 18:32:32 -0800 Subject: Enumify option, opt1, opt2, and opt3 --- src/map/battle.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/map/battle.cpp') diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 14ef933..d76abd5 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1361,7 +1361,7 @@ short *battle_get_sc_count(struct block_list *bl) return NULL; } -short *battle_get_opt1(struct block_list *bl) +Opt1 *battle_get_opt1(struct block_list *bl) { nullpo_retr(0, bl); if (bl->type == BL_MOB && (struct mob_data *) bl) @@ -1373,7 +1373,7 @@ short *battle_get_opt1(struct block_list *bl) return 0; } -short *battle_get_opt2(struct block_list *bl) +Opt2 *battle_get_opt2(struct block_list *bl) { nullpo_retr(0, bl); if (bl->type == BL_MOB && (struct mob_data *) bl) @@ -1385,7 +1385,7 @@ short *battle_get_opt2(struct block_list *bl) return 0; } -short *battle_get_opt3(struct block_list *bl) +Opt3 *battle_get_opt3(struct block_list *bl) { nullpo_retr(0, bl); if (bl->type == BL_MOB && (struct mob_data *) bl) @@ -1397,7 +1397,7 @@ short *battle_get_opt3(struct block_list *bl) return 0; } -short *battle_get_option(struct block_list *bl) +Option *battle_get_option(struct block_list *bl) { nullpo_retr(0, bl); if (bl->type == BL_MOB && (struct mob_data *) bl) @@ -4633,7 +4633,6 @@ int battle_weapon_attack(struct block_list *src, struct block_list *target, struct map_session_data *sd = NULL; eptr sc_data = battle_get_sc_data(src); eptr t_sc_data = battle_get_sc_data(target); - short *opt1; int race = 7, ele = 0; int damage, rdamage = 0; struct Damage wd; @@ -4652,8 +4651,8 @@ int battle_weapon_attack(struct block_list *src, struct block_list *target, && pc_isdead((struct map_session_data *) target)) return 0; - opt1 = battle_get_opt1(src); - if (opt1 && *opt1 > 0) + Opt1 *opt1 = battle_get_opt1(src); + if (opt1 != NULL && bool(*opt1)) { battle_stopattack(src); return 0; -- cgit v1.2.3-60-g2f50