diff --git a/data/dynos_mgr_builtin.cpp b/data/dynos_mgr_builtin.cpp index b750cd060..f5ecde10e 100644 --- a/data/dynos_mgr_builtin.cpp +++ b/data/dynos_mgr_builtin.cpp @@ -2037,6 +2037,7 @@ static const DynosBuiltinFunction sDynosBuiltinFuncs[] = { define_builtin_function(bhv_ambient_light_update, FUNCTION_BHV), define_builtin_function(bhv_point_light_init, FUNCTION_BHV), define_builtin_function(bhv_point_light_loop, FUNCTION_BHV), + define_builtin_function(geo_switch_character_type_ext, FUNCTION_GEO), }; static const char *sDynosBuiltinFuncTypeNames[] = { diff --git a/dynos/packs/Coop Cafe Pipe/warp_pipe_geo.bin b/dynos/packs/Coop Cafe Pipe/warp_pipe_geo.bin new file mode 100644 index 000000000..6e88dc161 Binary files /dev/null and b/dynos/packs/Coop Cafe Pipe/warp_pipe_geo.bin differ diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index ff35fe280..f48aa1f43 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -187,6 +187,21 @@ Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node) { return NULL; } +Gfx *geo_switch_character_type_ext(s32 callContext, struct GraphNode *node, UNUSED void *context) { + struct GraphNodeSwitchCase *switchCase; + + if (callContext == GEO_CONTEXT_RENDER) { + // move to a local var because GraphNodes are passed in all geo functions. + // cast the pointer. + switchCase = (struct GraphNodeSwitchCase *) node; + + // assign the case number for execution. + switchCase->selectedCase = gMarioState->character->type; + } + + return NULL; +} + s16 gRoomOverride = -1; /* |description|Overrides the current room Mario is in. Set to -1 to reset override|descriptionEnd| */ diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h index d004ecbeb..9e8ef665c 100644 --- a/src/game/object_helpers.h +++ b/src/game/object_helpers.h @@ -71,6 +71,7 @@ Gfx *geo_switch_area(s32 callContext, struct GraphNode *node, UNUSED void *conte Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node); Gfx *geo_switch_area(s32 callContext, struct GraphNode *node); #endif +Gfx *geo_switch_character_type_ext(s32 callContext, struct GraphNode *node, UNUSED void *context); Gfx *geo_choose_area_ext(s32 callContext, UNUSED struct GraphNode *node, Mat4 mtx); void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1); void obj_apply_scale_to_matrix(struct Object *obj, VEC_OUT Mat4 dst, Mat4 src);