add settings if they dont exist

add helper for spawnerinfo config data
This commit is contained in:
David Markowitz
2024-05-21 04:27:17 -07:00
parent bfeb10c972
commit a153d0a78c
3 changed files with 37 additions and 16 deletions

View File

@@ -7,6 +7,15 @@
#include "GeneralUtils.h"
#include "dZoneManager.h"
bool SpawnerNode::HasVar(const std::u16string_view view) {
for (const auto* data : config) {
if (data->GetKey() == view) {
return true;
}
}
return false;
}
Spawner::Spawner(const SpawnerInfo info) {
m_Info = info;
m_Active = m_Info.activeOnLoad && info.spawnActivator;

View File

@@ -10,6 +10,7 @@
#include <functional>
#include "LDFFormat.h"
#include "EntityInfo.h"
#include <string_view>
struct SpawnerNode {
NiPoint3 position = NiPoint3Constant::ZERO;
@@ -18,6 +19,8 @@ struct SpawnerNode {
uint32_t nodeMax = 1;
std::vector<LWOOBJID> entities;
std::vector<LDFBaseData*> config;
bool HasVar(const std::u16string_view view);
};
struct SpawnerInfo {