cleanup indentation around trees drop sticks (#4778)

* cleanup indentation around trees drop sticks

* combine the range check
This commit is contained in:
Philip Dubé 2025-01-03 06:07:14 +00:00 committed by GitHub
parent 7e481c3f69
commit 6133ebe135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -358,23 +358,21 @@ void EnWood02_Update(Actor* thisx, PlayState* play2) {
dropsSpawnPt = this->actor.world.pos;
dropsSpawnPt.y += 200.0f;
if ((this->unk_14C >= 0) && (this->unk_14C < 0x64) && (CVarGetInteger(CVAR_ENHANCEMENT("TreesDropSticks"), 0)) && !(INV_CONTENT(ITEM_STICK) == ITEM_NONE)) {
(numDrops = (Rand_ZeroOne() * 4));
for (i = 0; i < numDrops; ++i) {
Item_DropCollectible(play, &dropsSpawnPt, ITEM00_STICK);
}
} else {
if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) {
Item_DropCollectibleRandom(play, &this->actor, &dropsSpawnPt, this->unk_14C << 4);
} else {
if (this->actor.home.rot.z != 0) {
this->actor.home.rot.z &= 0x1FFF;
this->actor.home.rot.z |= 0xE000;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, dropsSpawnPt.x, dropsSpawnPt.y,
dropsSpawnPt.z, 0, this->actor.world.rot.y, 0, this->actor.home.rot.z, true);
this->actor.home.rot.z = 0;
if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) {
if (CVarGetInteger(CVAR_ENHANCEMENT("TreesDropSticks"), 0) && INV_CONTENT(ITEM_STICK) != ITEM_NONE) {
numDrops = Rand_ZeroOne() * 4;
for (i = 0; i < numDrops; ++i) {
Item_DropCollectible(play, &dropsSpawnPt, ITEM00_STICK);
}
} else {
Item_DropCollectibleRandom(play, &this->actor, &dropsSpawnPt, this->unk_14C << 4);
}
} else if (this->actor.home.rot.z != 0) {
this->actor.home.rot.z &= 0x1FFF;
this->actor.home.rot.z |= 0xE000;
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, dropsSpawnPt.x, dropsSpawnPt.y,
dropsSpawnPt.z, 0, this->actor.world.rot.y, 0, this->actor.home.rot.z, true);
this->actor.home.rot.z = 0;
}
// Spawn falling leaves