From fb775165ce9de0c3e991330a323c7fc84b326fc9 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 2 Oct 2020 23:35:06 -0700 Subject: [PATCH] Fixed bug with whirlpools --- include/object_fields.h | 1 + src/game/behaviors/whirlpool.inc.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/object_fields.h b/include/object_fields.h index 4bc13834..5a2b668e 100644 --- a/include/object_fields.h +++ b/include/object_fields.h @@ -1130,6 +1130,7 @@ /* Whirlpool */ #define /*0x0F4*/ oWhirlpoolInitFacePitch OBJECT_FIELD_S32(0x1B) #define /*0x0F8*/ oWhirlpoolInitFaceRoll OBJECT_FIELD_S32(0x1C) +#define /*0x0FC*/ oWhirlpoolTimeout OBJECT_FIELD_S32(0x1D) /* White Puff Explode */ #define /*0x0F4*/ oWhitePuffUnkF4 OBJECT_FIELD_F32(0x1B) diff --git a/src/game/behaviors/whirlpool.inc.c b/src/game/behaviors/whirlpool.inc.c index 5aebebd2..64867e86 100644 --- a/src/game/behaviors/whirlpool.inc.c +++ b/src/game/behaviors/whirlpool.inc.c @@ -35,6 +35,15 @@ void whirpool_orient_graph(void) { } void bhv_whirlpool_loop(void) { + if (o->oWhirlpoolTimeout > 0) { + o->oWhirlpoolTimeout--; + if (o->oWhirlpoolTimeout <= 0) { + o->oInteractStatus = 0; + } + } else if (o->oInteractStatus == INT_STATUS_INTERACTED) { + o->oWhirlpoolTimeout = 30; + } + #ifndef NODRAWINGDISTANCE if (o->oDistanceToMario < 5000.0f) { #endif