Skip to content

Commit 59fc452

Browse files
committed
fix(zc): empty item slots filling wrongly
1 parent 5fef068 commit 59fc452

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/zc/hero.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10211,7 +10211,9 @@ static void deselectbombsWPN(word& wpos, int32_t& BTNwpn, int32_t& directItemBTN
1021110211
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
1021210212
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
1021310213
auto temp = pg->movepos_legacy(SEL_VERIFY_LEFT, wpos, fp1, fp2, fp3);
10214-
BTNwpn = pg->get_item_pos(temp>>8);
10214+
if((temp&0xFF) == 0xFF)
10215+
BTNwpn = -1;
10216+
else BTNwpn = pg->get_item_pos(temp>>8);
1021510217
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
1021610218
wpos = temp;
1021710219
}
@@ -28617,7 +28619,9 @@ static void selectNextBTNWpn(int32_t type, word& wpos, int32_t& BTNwpn,
2861728619
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
2861828620
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
2861928621
auto ret = pg->movepos_legacy(type, wpos, fp1, fp2, fp3);
28620-
BTNwpn = pg->get_item_pos(ret>>8);
28622+
if((ret&0xFF) == 0xFF)
28623+
BTNwpn = -1;
28624+
else BTNwpn = pg->get_item_pos(ret>>8);
2862128625
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
2862228626
wpos = ret;
2862328627
}
@@ -28666,7 +28670,9 @@ static void verifyWpn(word& wpos, int32_t& BTNwpn, int32_t& directItemBTN, word
2866628670
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
2866728671
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
2866828672
wpos = pg->movepos_legacy(SEL_VERIFY_RIGHT, wpos, fp1, fp2, fp3);
28669-
BTNwpn = pg->get_item_pos(wpos>>8);
28673+
if((wpos&0xFF) == 0xFF)
28674+
BTNwpn = -1;
28675+
else BTNwpn = pg->get_item_pos(wpos>>8);
2867028676
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
2867128677
}
2867228678

0 commit comments

Comments
 (0)