Fix "SpawnActor::CanBeApplied" check which would also actually spawn the actor, thus causing two actors two be spawned (also fix for WithOffset) (#5822)

This commit is contained in:
Nivomi
2025-10-02 18:47:48 -04:00
committed by GitHub
parent 5cac826f97
commit c22fbc08d7

View File

@@ -632,10 +632,10 @@ void SlipperyFloor::_Remove() {
// MARK: - SpawnEnemyWithOffset
GameInteractionEffectQueryResult SpawnEnemyWithOffset::CanBeApplied() {
if (!GameInteractor::IsSaveLoaded(true)) {
if (!GameInteractor::CanSpawnActor()) {
return GameInteractionEffectQueryResult::TemporarilyNotPossible;
}
return GameInteractor::RawAction::SpawnEnemyWithOffset(parameters[0], parameters[1]);
return GameInteractionEffectQueryResult::Possible;
}
void SpawnEnemyWithOffset::_Apply() {
@@ -644,10 +644,10 @@ void SpawnEnemyWithOffset::_Apply() {
// MARK: - SpawnActor
GameInteractionEffectQueryResult SpawnActor::CanBeApplied() {
if (!GameInteractor::IsSaveLoaded(true)) {
if (!GameInteractor::CanSpawnActor()) {
return GameInteractionEffectQueryResult::TemporarilyNotPossible;
}
return GameInteractor::RawAction::SpawnActor(parameters[0], parameters[1]);
return GameInteractionEffectQueryResult::Possible;
}
void SpawnActor::_Apply() {