You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Fix STAR_DANCE_USES_STARS_MODEL define (#688)
This commit is contained in:
@@ -825,6 +825,8 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
|
||||
m->interactObj = obj;
|
||||
m->usedObj = obj;
|
||||
|
||||
gStarModelLastCollected = obj_get_model_id(obj);
|
||||
|
||||
#ifdef GLOBAL_STAR_IDS
|
||||
starIndex = (obj->oBehParams >> 24) & 0xFF;
|
||||
#else
|
||||
|
||||
@@ -1238,6 +1238,16 @@ s32 init_level(void) {
|
||||
|
||||
g100CoinStarSpawned = FALSE;
|
||||
|
||||
// NOTE: gStarModelLastCollected reset here as a safety to prevent possible UB if assigned a model used
|
||||
// in a non-global group. This checked can be removed as needed.
|
||||
if (gStarModelLastCollected != MODEL_BOWSER_KEY
|
||||
#ifdef STAR_DANCE_USES_STARS_MODEL
|
||||
|| gStarModelLastCollected != MODEL_TRANSPARENT_STAR
|
||||
#endif
|
||||
) {
|
||||
gStarModelLastCollected = MODEL_STAR;
|
||||
}
|
||||
|
||||
if (gCurrCreditsEntry == NULL) {
|
||||
gHudDisplay.flags = HUD_DISPLAY_DEFAULT;
|
||||
} else {
|
||||
|
||||
@@ -35,6 +35,7 @@ static struct Object *sEndLeftToadObj;
|
||||
static struct Object *sEndJumboStarObj;
|
||||
static s16 sEndPeachAnimation;
|
||||
static s16 sEndToadAnims[2];
|
||||
ModelID32 gStarModelLastCollected = MODEL_STAR;
|
||||
|
||||
Vp sEndCutsceneVp = {
|
||||
{
|
||||
@@ -589,10 +590,10 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
|
||||
case 1:
|
||||
celebStar = spawn_object(m->marioObj, MODEL_STAR, bhvCelebrationStar);
|
||||
#ifdef STAR_DANCE_USES_STARS_MODEL
|
||||
celebStar->header.gfx.sharedChild = m->interactObj->header.gfx.sharedChild;
|
||||
obj_set_model(celebStar, gStarModelLastCollected);
|
||||
#else
|
||||
if (obj_has_model(m->interactObj, MODEL_BOWSER_KEY)) {
|
||||
obj_set_model(celebStar, MODEL_BOWSER_KEY);
|
||||
if (gStarModelLastCollected == MODEL_BOWSER_KEY) {
|
||||
obj_set_model(celebStar, gStarModelLastCollected);
|
||||
}
|
||||
#endif
|
||||
disable_background_sound();
|
||||
|
||||
@@ -127,6 +127,8 @@ enum EndToadAnimIndex {
|
||||
END_TOAD_INDEX_EAST,
|
||||
};
|
||||
|
||||
extern ModelID32 gStarModelLastCollected;
|
||||
|
||||
void print_displaying_credits_entry(void);
|
||||
void bhv_end_peach_loop(void);
|
||||
void bhv_end_toad_loop(void);
|
||||
|
||||
Reference in New Issue
Block a user