mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
Fixes choose-quest with missing MQ crash. (#1903)
This commit is contained in:
parent
c5940905e7
commit
75af33a04c
@ -663,8 +663,22 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
|
|||||||
if (ABS(this->stickRelX) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) {
|
if (ABS(this->stickRelX) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) {
|
||||||
if (this->stickRelX > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT))) {
|
if (this->stickRelX > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT))) {
|
||||||
this->questType[this->buttonIndex] += 1;
|
this->questType[this->buttonIndex] += 1;
|
||||||
|
if (this->questType[this->buttonIndex] == MASTER_QUEST && !ResourceMgr_GameHasMasterQuest()) {
|
||||||
|
// the only case not handled by the MIN/MAX_QUEST logic below. This will either put it at
|
||||||
|
// above MAX_QUEST in which case it will wrap back around, or it will put it on MAX_QUEST
|
||||||
|
// in which case if MAX_QUEST even is that number it will be a valid selection that won't
|
||||||
|
// crash.
|
||||||
|
this->questType[this->buttonIndex] += 1;
|
||||||
|
}
|
||||||
} else if (this->stickRelX < -30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT))) {
|
} else if (this->stickRelX < -30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT))) {
|
||||||
this->questType[this->buttonIndex] -= 1;
|
this->questType[this->buttonIndex] -= 1;
|
||||||
|
if (this->questType[this->buttonIndex] == MASTER_QUEST && !ResourceMgr_GameHasMasterQuest()) {
|
||||||
|
// the only case not handled by the MIN/MAX_QUEST logic below. This will either put it at
|
||||||
|
// below MIN_QUEST in which case it will wrap back around, or it will put it on MIN_QUEST
|
||||||
|
// in which case if MIN_QUEST even is that number it will be a valid selection that won't
|
||||||
|
// crash.
|
||||||
|
this->questType[this->buttonIndex] -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->questType[this->buttonIndex] > MAX_QUEST) {
|
if (this->questType[this->buttonIndex] > MAX_QUEST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user