Skip to content

Commit

Permalink
fix mm acorn star spawning while above a warp plane
Browse files Browse the repository at this point in the history
  • Loading branch information
kittrz committed Mar 9, 2023
1 parent 214428a commit d4b98ce
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/game/behaviors/maple_objects.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ void bhv_cherry_tree_loop(void) {
else {
obj_scale_xyz(o, 1, 1, 1);

if (o->oTimer == 30) {
if (!o->oF4) {
s16 remainingTriggers = count_objects_with_behavior(bhvTreeNut);
if (remainingTriggers == 0) {
struct Object *starObj = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStarSpawnCoordinates, gMarioObject->oPosX, gMarioObject->oPosY + 300, gMarioObject->oPosZ, 0, 0, 0);
starObj->oBehParams = 0x04010000;
starObj->oHomeX = starObj->oPosX;
starObj->oHomeY = starObj->oPosY;
starObj->oHomeZ = starObj->oPosZ;
if(!SURFACE_IS_WARP_PLANE(gMarioState->floor->type)) {
o->oF4 = 1;
if (remainingTriggers == 0) {
struct Object *starObj = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStarSpawnCoordinates, gMarioObject->oPosX, gMarioObject->oPosY + 300, gMarioObject->oPosZ, 0, 0, 0);
starObj->oBehParams = 0x04010000;
starObj->oHomeX = starObj->oPosX;
starObj->oHomeY = starObj->oPosY;
starObj->oHomeZ = starObj->oPosZ;
}
}
}
}
Expand Down

0 comments on commit d4b98ce

Please sign in to comment.