Skip to content

Commit

Permalink
fix(zc): empty item slots filling wrongly
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Sep 7, 2023
1 parent 5fef068 commit 59fc452
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/zc/hero.cpp
Expand Up @@ -10211,7 +10211,9 @@ static void deselectbombsWPN(word& wpos, int32_t& BTNwpn, int32_t& directItemBTN
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
auto temp = pg->movepos_legacy(SEL_VERIFY_LEFT, wpos, fp1, fp2, fp3);
BTNwpn = pg->get_item_pos(temp>>8);
if((temp&0xFF) == 0xFF)
BTNwpn = -1;
else BTNwpn = pg->get_item_pos(temp>>8);
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
wpos = temp;
}
Expand Down Expand Up @@ -28617,7 +28619,9 @@ static void selectNextBTNWpn(int32_t type, word& wpos, int32_t& BTNwpn,
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
auto ret = pg->movepos_legacy(type, wpos, fp1, fp2, fp3);
BTNwpn = pg->get_item_pos(ret>>8);
if((ret&0xFF) == 0xFF)
BTNwpn = -1;
else BTNwpn = pg->get_item_pos(ret>>8);
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
wpos = ret;
}
Expand Down Expand Up @@ -28666,7 +28670,9 @@ static void verifyWpn(word& wpos, int32_t& BTNwpn, int32_t& directItemBTN, word
auto fp2 = ((f2&0xFF)==255) ? 255 : ((empty || (f2&0xFF)==(wpos&0xFF)) ? f2 : 255);
auto fp3 = ((f3&0xFF)==255) ? 255 : ((empty || (f3&0xFF)==(wpos&0xFF)) ? f3 : 255);
wpos = pg->movepos_legacy(SEL_VERIFY_RIGHT, wpos, fp1, fp2, fp3);
BTNwpn = pg->get_item_pos(wpos>>8);
if((wpos&0xFF) == 0xFF)
BTNwpn = -1;
else BTNwpn = pg->get_item_pos(wpos>>8);
directItemBTN = NEG_OR_MASK(BTNwpn,0xFFF);
}

Expand Down

0 comments on commit 59fc452

Please sign in to comment.