Fixed player spawning in unknown world.
This may happen if the admin removes a world.
This commit is contained in:
parent
29910bc3bd
commit
9e1f67932b
@ -1671,6 +1671,10 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
|
|||||||
|
|
||||||
m_LoadedWorldName = root.get("world", "world").asString();
|
m_LoadedWorldName = root.get("world", "world").asString();
|
||||||
a_World = cRoot::Get()->GetWorld(GetLoadedWorldName(), false);
|
a_World = cRoot::Get()->GetWorld(GetLoadedWorldName(), false);
|
||||||
|
if (a_World == NULL)
|
||||||
|
{
|
||||||
|
a_World = cRoot::Get()->GetDefaultWorld();
|
||||||
|
}
|
||||||
|
|
||||||
m_LastBedPos.x = root.get("SpawnX", a_World->GetSpawnX()).asInt();
|
m_LastBedPos.x = root.get("SpawnX", a_World->GetSpawnX()).asInt();
|
||||||
m_LastBedPos.y = root.get("SpawnY", a_World->GetSpawnY()).asInt();
|
m_LastBedPos.y = root.get("SpawnY", a_World->GetSpawnY()).asInt();
|
||||||
|
Loading…
Reference in New Issue
Block a user