diff --git a/src/ServerLib/Components/ServerEnvironmentSwitchComponent.cpp b/src/ServerLib/Components/ServerEnvironmentSwitchComponent.cpp index 5019e5e..14f51f5 100644 --- a/src/ServerLib/Components/ServerEnvironmentSwitchComponent.cpp +++ b/src/ServerLib/Components/ServerEnvironmentSwitchComponent.cpp @@ -51,8 +51,6 @@ namespace tsom } handleEnvironmentSwitch(oldEntity, newEntity, relativeTransform); - newEntity.get().GetClass()->ActivateEntity(newEntity); - OnEntitySwitchedEnvironment(oldEntity, newEntity, newEnvironment, relativeTransform); oldEntity.destroy(); } diff --git a/src/ServerLib/Entities/ServerClassLibrary.cpp b/src/ServerLib/Entities/ServerClassLibrary.cpp index ffe9a1a..90279ee 100644 --- a/src/ServerLib/Entities/ServerClassLibrary.cpp +++ b/src/ServerLib/Entities/ServerClassLibrary.cpp @@ -71,6 +71,8 @@ namespace tsom newEntity.emplace(player->CreateHandle()); + newEntity.get().GetClass()->ActivateEntity(newEntity); + if (newEnvironment->IsRoot()) player->UpdateRootEnvironment(newEnvironment); }; @@ -148,6 +150,8 @@ namespace tsom newEntity.emplace(physicsSettings); newEntity.emplace().ownerShip = shipEnvironment; + newEntity.get().GetClass()->ActivateEntity(newEntity); + // Change the root environment of players in the ship as well if (newEnvironment->IsRoot()) {