Skip to content

Commit

Permalink
Server/EnvironmentSwitch: Fix when switching planet while in a ship
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Dec 9, 2024
1 parent 63e5aae commit e034b4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ServerLib/Components/ServerEnvironmentSwitchComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
#include <ServerLib/ServerEnvironment.hpp>
#include <ServerLib/Components/NetworkedComponent.hpp>
#include <ServerLib/Systems/NetworkedEntitiesSystem.hpp>
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <entt/entt.hpp>

namespace tsom
{
void ServerEnvironmentSwitchComponent::Switch(entt::handle oldEntity, ServerEnvironment* previousEnvironment, ServerEnvironment* newEnvironment, const EnvironmentTransform& relativeTransform)
{
// Disable old entity to not take it into account in the callbacks (for example when changing root environment)
oldEntity.emplace<Nz::DisabledComponent>();

auto& previousNode = oldEntity.get<Nz::NodeComponent>();
auto& previousClassInstance = oldEntity.get<ClassInstanceComponent>();

Expand Down

0 comments on commit e034b4c

Please sign in to comment.