From: Slimebreath6078 Date: Sun, 27 Mar 2022 13:23:42 +0000 (+0900) Subject: [Fix] next_mirror で鏡のマスと同じ座標にある場合、抽選し直すように修正 X-Git-Tag: 3.0.0Alpha58^2~6^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=9099c30baeaff993613ebb6020aa3d36224da902;p=hengbandforosx%2Fhengbandosx.git [Fix] next_mirror で鏡のマスと同じ座標にある場合、抽選し直すように修正 抽選し直しは可読性を考え、do-whileで実装 --- diff --git a/src/spell-class/spells-mirror-master.cpp b/src/spell-class/spells-mirror-master.cpp index 2a6affce0..4a03b6a23 100644 --- a/src/spell-class/spells-mirror-master.cpp +++ b/src/spell-class/spells-mirror-master.cpp @@ -255,8 +255,10 @@ void SpellsMirrorMaster::next_mirror(int *next_y, int *next_x, int cury, int cur return; } - *next_y = cury + randint0(5) - 2; - *next_x = curx + randint0(5) - 2; + do { + *next_y = cury + randint0(5) - 2; + *next_x = curx + randint0(5) - 2; + } while ((*next_y == cury) && (*next_x == curx)); } void SpellsMirrorMaster::project_seeker_ray(int target_x, int target_y, int dam)