Skip to content

Commit

Permalink
Exempt spawned enemies from "clear enemy" rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
aMannus committed Aug 22, 2024
1 parent 31531d5 commit 45b3b5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,13 +625,15 @@ GameInteractionEffectQueryResult GameInteractor::RawAction::SpawnEnemyWithOffset
return GameInteractionEffectQueryResult::TemporarilyNotPossible;
}
NameTag_RegisterForActorWithOptions(actor, viewerName.c_str(), { .tag = "CrowdControl" });
Actor_ChangeCategory(gPlayState, &gPlayState->actorCtx, actor, ACTORCAT_NPC);
}
return GameInteractionEffectQueryResult::Possible;
} else {
Actor* actor =
Actor_Spawn(&gPlayState->actorCtx, gPlayState, enemyId, pos.x, pos.y, pos.z, 0, 0, 0, enemyParams, 0);
if (actor != NULL) {
NameTag_RegisterForActorWithOptions(actor, viewerName.c_str(), { .tag = "CrowdControl" });
Actor_ChangeCategory(gPlayState, &gPlayState->actorCtx, actor, ACTORCAT_NPC);
return GameInteractionEffectQueryResult::Possible;
}
}
Expand Down
4 changes: 4 additions & 0 deletions soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ void EnAttackNiw_Init(Actor* thisx, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->actor.shape.rot.y = this->actor.world.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f;
this->actionFunc = func_809B5670;

if (CVarGetInteger("gCrowdControl", 0)) {
Actor_ChangeCategory(gPlayState, &gPlayState->actorCtx, this, ACTORCAT_NPC);
}
}

void EnAttackNiw_Destroy(Actor* thisx, PlayState* play) {
Expand Down

0 comments on commit 45b3b5c

Please sign in to comment.