Added tree particle fix

This commit is contained in:
Reonu
2021-06-27 22:04:25 +01:00
parent 42a0129e81
commit 15acfce39d
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
#include "config.h"
// tree_particles.c.inc
void bhv_tree_snow_or_leaf_loop(void) {
@@ -33,15 +34,23 @@ void bhv_tree_snow_or_leaf_loop(void) {
void bhv_snow_leaf_particle_spawn_init(void) {
struct Object *obj; // Either snow or leaf
#ifdef TREE_PARTICLE_FIX
struct Object *nearestTree = NULL;
#endif
UNUSED s32 unused;
s32 isSnow;
f32 scale;
UNUSED s32 unused2;
gMarioObject->oActiveParticleFlags &= ~0x2000;
#ifdef TREE_PARTICLE_FIX
nearestTree = cur_obj_nearest_object_with_behavior(bhvTree);
isSnow = (nearestTree->header.gfx.sharedChild == gLoadedGraphNodes[MODEL_CCM_SNOW_TREE] || nearestTree->header.gfx.sharedChild == gLoadedGraphNodes[MODEL_SL_SNOW_TREE]);
#else
if (gCurrLevelNum == LEVEL_CCM || gCurrLevelNum == LEVEL_SL)
isSnow = 1;
else
isSnow = 0;
#endif
if (isSnow) {
if (random_float() < 0.5) {
obj = spawn_object(o, MODEL_WHITE_PARTICLE_DL, bhvTreeSnow);