mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
Properly place build activator
The build activator as a result of the previous changes was spawning at the wrong position. This commit pulls the activators position from the settings (should they exist) and sets them accordingly.
This commit is contained in:
parent
8bdd5b6e2c
commit
7dfcd22a2e
@ -22,6 +22,16 @@ RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
|
||||
{
|
||||
m_Precondition = new PreconditionExpression(GeneralUtils::UTF16ToWTF8(checkPreconditions));
|
||||
}
|
||||
|
||||
auto positionAsVector = GeneralUtils::SplitString(m_Parent->GetVarAsString(u"rebuild_activators"), 31);
|
||||
if (positionAsVector.size() == 3) {
|
||||
m_ActivatorPosition.x = std::stof(positionAsVector[0]);
|
||||
m_ActivatorPosition.y = std::stof(positionAsVector[1]);
|
||||
m_ActivatorPosition.z = std::stof(positionAsVector[2]);
|
||||
} else {
|
||||
m_ActivatorPosition = m_Parent->GetPosition();
|
||||
}
|
||||
SpawnActivator();
|
||||
}
|
||||
|
||||
RebuildComponent::~RebuildComponent() {
|
||||
|
Loading…
Reference in New Issue
Block a user