From 00da6b5977574a0564169172227d8aab45be188f Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 3 Jan 2015 21:07:56 -0800 Subject: 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. --- src/map/battle.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/map/battle.cpp') 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 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 src, dumb_ptr 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, -- cgit v1.2.3-70-g09d2