diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-03 21:07:56 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-03 21:58:26 -0800 |
commit | 00da6b5977574a0564169172227d8aab45be188f (patch) | |
tree | dd52eee506a98e1eb9fcdea52e7db25079a7ad28 /src/map/battle.cpp | |
parent | 4c91abd6a020ee030114ae3f22d8f6066e7528be (diff) | |
download | tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.gz tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.bz2 tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.xz tmwa-00da6b5977574a0564169172227d8aab45be188f.zip |
Switch MATCH to separate begin/end macros
The for loop trick turned out to be very prone to infinite loops
at runtime. It's better to force compiler errors even if it's ugly.
Diffstat (limited to 'src/map/battle.cpp')
-rw-r--r-- | src/map/battle.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 0a6ffa7..96945a4 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1400,8 +1400,11 @@ struct Damage battle_calc_pc_weapon_attack(dumb_ptr<block_list> src, if (widx.ok()) { - if OPTION_IS_SOME_NOLOOP(sdidw, sd->inventory_data[widx]) + OMATCH_BEGIN_SOME (sdidw, sd->inventory_data[widx]) + { atkmin = atkmin * (80 + sdidw->wlv * 20) / 100; + } + OMATCH_END (); } if (sd->status.weapon == ItemLook::BOW) { //武器が弓矢の場合 @@ -1921,13 +1924,14 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target, ItemNameId weapon; if (weapon_index.ok()) { - if OPTION_IS_SOME_NOLOOP(sdidw, sd->inventory_data[weapon_index]) + OMATCH_BEGIN_SOME (sdidw, sd->inventory_data[weapon_index]) { if (bool(sd->status.inventory[weapon_index].equip & EPOS::WEAPON)) { weapon = sdidw->nameid; } } + OMATCH_END (); } MAP_LOG("PC%d %s:%d,%d WPNDMG %s%d %d FOR %d WPN %d"_fmt, |