mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
fix(character): arriving in a world starts at the target scene or the zone's spawn
A player who had been to a world before arrived at that world's saved respawn point instead of the zone's spawn. The saved point is where a death in that world respawns, not where arriving starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -187,8 +187,9 @@ void ControllablePhysicsComponent::LoadFromSaveData(const tinyxml2::XMLDocument&
|
||||
PlaceCharacter();
|
||||
}
|
||||
|
||||
// If it came from another zone it starts at its respawn point, the target scene or the zone's spawn (Moon Base always:
|
||||
// the saved place tends to be on the roof; a target scene too: only possible in a test map)
|
||||
// If it came from another zone it starts at the target scene or the zone's spawn (Moon Base always: the saved place
|
||||
// tends to be on the roof; a target scene too: only possible in a test map). A world's saved respawn point is where a
|
||||
// death there respawns, not where arriving starts.
|
||||
void ControllablePhysicsComponent::PlaceCharacter() {
|
||||
auto* const character = m_Parent->GetCharacter();
|
||||
if (!character) return;
|
||||
@@ -201,10 +202,7 @@ void ControllablePhysicsComponent::PlaceCharacter() {
|
||||
NiQuaternion rot = QuatUtils::IDENTITY;
|
||||
|
||||
auto* targetScene = Game::entityManager->GetSpawnPointEntity(targetSceneName);
|
||||
if (character->HasBeenToWorld(mapID) && targetSceneName.empty()) {
|
||||
pos = character->GetRespawnPoint(mapID);
|
||||
rot = Game::zoneManager->GetZone()->GetSpawnRot();
|
||||
} else if (targetScene != nullptr) {
|
||||
if (targetScene != nullptr) {
|
||||
pos = targetScene->GetPosition();
|
||||
rot = targetScene->GetRotation();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user