mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 23:17:28 +00:00
get zones from settings
This commit is contained in:
parent
cc23538244
commit
81af1f382e
@ -6,16 +6,13 @@
|
|||||||
|
|
||||||
RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(parent) {
|
RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(parent) {
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
|
std::string zoneString = GeneralUtils::UTF16ToWTF8(m_Parent->GetVar<std::u16string>(u"MultiZoneIDs"));
|
||||||
// get the lup worlds from the cdclient
|
std::stringstream ss(zoneString);
|
||||||
std::string query = "SELECT * FROM LUPZoneIDs;";
|
for (int i; ss >> i;) {
|
||||||
auto results = CDClientDatabase::ExecuteQuery(query);
|
m_LUPWorlds.push_back(i);
|
||||||
while (!results.eof()) {
|
if (ss.peek() == ';')
|
||||||
// fallback to 1600 incase there is an issue
|
ss.ignore();
|
||||||
m_LUPWorlds.push_back(results.getIntField(0, 1600));
|
|
||||||
results.nextRow();
|
|
||||||
}
|
}
|
||||||
results.finalize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RocketLaunchLupComponent::~RocketLaunchLupComponent() {}
|
RocketLaunchLupComponent::~RocketLaunchLupComponent() {}
|
||||||
@ -29,11 +26,7 @@ void RocketLaunchLupComponent::OnUse(Entity* originator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RocketLaunchLupComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
void RocketLaunchLupComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
||||||
// Add one to index because the actual LUP worlds start at index 1.
|
|
||||||
index++;
|
|
||||||
|
|
||||||
auto* rocketLaunchpadControlComponent = m_Parent->GetComponent<RocketLaunchpadControlComponent>();
|
auto* rocketLaunchpadControlComponent = m_Parent->GetComponent<RocketLaunchpadControlComponent>();
|
||||||
|
|
||||||
if (!rocketLaunchpadControlComponent) return;
|
if (!rocketLaunchpadControlComponent) return;
|
||||||
|
|
||||||
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0);
|
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user