Fix NPC softlock (cannon and hoot)

Bug reported by somario360:
When trying to open the cannon in a level (so far tested in BOB & WF) the cannon dialogue will repeat infinitely. Sometimes the cannon will open, but the game will crash after.

The code I had written previously to prevent softlocks ended up causing
them due to a incorrect check of activeFlags.
This commit is contained in:
MysterD 2020-08-30 23:12:28 -07:00
parent 96a2cacf2d
commit 7b073aedb8

View file

@ -396,7 +396,7 @@ s32 act_reading_npc_dialog(struct MarioState *m) {
s16 angleToNPC;
if (m->playerIndex == 0) {
if (m->usedObj == NULL || m->usedObj->activeFlags != ACTIVE_FLAG_DEACTIVATED || m->usedObj->behavior != localDialogNPCBehavior) {
if (m->usedObj == NULL || m->usedObj->activeFlags == ACTIVE_FLAG_DEACTIVATED || m->usedObj->behavior != localDialogNPCBehavior) {
set_mario_npc_dialog(m, 0);
}
}