fix: Remove hard coded groups for spawners (#1454)

* fix macros not trimming newline

* Remove hardcoded spawner groups

Was just missing an inline script implementation and using the wrong name
This commit is contained in:
David Markowitz
2024-02-10 22:38:21 -08:00
committed by GitHub
parent f7e4a32621
commit ddaac276fe
5 changed files with 25 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
#include "NpcCowboyServer.h"
#include "eMissionState.h"
#include "InventoryComponent.h"
#include "dZoneManager.h"
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != 1880) {
@@ -23,4 +24,17 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
inventoryComponent->RemoveItem(14378, 1);
}
// Next up hide or show the samples based on the mission state
int32_t visible = 1;
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
visible = 0;
}
auto spawners = Game::zoneManager->GetSpawnersByName("PlungerGunTargets");
for (auto* spawner : spawners) {
for (const auto entity : spawner->GetSpawnedObjectIDs())
GameMessages::SendNotifyClientObject(entity, u"SetVisibility", visible, 0,
target->GetObjectID(), "", target->GetSystemAddress());
}
}