summaryrefslogtreecommitdiff
path: root/src/map/battle.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-12-20 18:32:32 -0800
committerBen Longbons <b.r.longbons@gmail.com>2012-12-24 10:02:19 -0800
commit2b092c150e1226decc48160316070fc44d5fbba0 (patch)
tree48456d14896059fd223401aa15d4e29010a81436 /src/map/battle.cpp
parentb52127bcbf817ff8285b36d22198b275327e16bb (diff)
downloadtmwa-2b092c150e1226decc48160316070fc44d5fbba0.tar.gz
tmwa-2b092c150e1226decc48160316070fc44d5fbba0.tar.bz2
tmwa-2b092c150e1226decc48160316070fc44d5fbba0.tar.xz
tmwa-2b092c150e1226decc48160316070fc44d5fbba0.zip
Enumify option, opt1, opt2, and opt3
Diffstat (limited to 'src/map/battle.cpp')
-rw-r--r--src/map/battle.cpp13
1 files changed, 6 insertions, 7 deletions
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<struct status_change, StatusChange> sc_data = battle_get_sc_data(src);
eptr<struct status_change, StatusChange> 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;