Explicitly set spawnpoint fixes.
The value names are case-insensitive. The debug message is printed only once.
This commit is contained in:
parent
2383016b1d
commit
78f9d97459
@ -486,30 +486,21 @@ void cWorld::Start(void)
|
|||||||
}
|
}
|
||||||
} // switch (m_Dimension)
|
} // switch (m_Dimension)
|
||||||
|
|
||||||
// Try to find the "SpawnPosition" key in the world configuration
|
// Try to find the "SpawnPosition" key and coord values in the world configuration, set the flag if found
|
||||||
// Set a boolean value if so
|
|
||||||
int KeyNum = IniFile.FindKey("SpawnPosition");
|
int KeyNum = IniFile.FindKey("SpawnPosition");
|
||||||
unsigned int NumSpawnPositionKeys = ((KeyNum != -1) ? (IniFile.GetNumValues(KeyNum)) : 0);
|
m_bSpawnExplicitlySet =
|
||||||
|
(
|
||||||
if (NumSpawnPositionKeys > 0)
|
(KeyNum >= 0) &&
|
||||||
{
|
(
|
||||||
for (unsigned int i = 0; i < NumSpawnPositionKeys; i++)
|
(IniFile.FindValue(KeyNum, "X") >= 0) ||
|
||||||
{
|
(IniFile.FindValue(KeyNum, "Y") >= 0) ||
|
||||||
AString ValueName = IniFile.GetValueName(KeyNum, i);
|
(IniFile.FindValue(KeyNum, "Z") >= 0)
|
||||||
if (
|
)
|
||||||
(ValueName.compare("X") == 0) ||
|
);
|
||||||
(ValueName.compare("Y") == 0) ||
|
|
||||||
(ValueName.compare("Z") == 0)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
m_bSpawnExplicitlySet = true;
|
|
||||||
LOGD("Spawnpoint explicitly set!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bSpawnExplicitlySet)
|
if (m_bSpawnExplicitlySet)
|
||||||
{
|
{
|
||||||
|
LOGD("Spawnpoint explicitly set!");
|
||||||
m_SpawnX = IniFile.GetValueF("SpawnPosition", "X", m_SpawnX);
|
m_SpawnX = IniFile.GetValueF("SpawnPosition", "X", m_SpawnX);
|
||||||
m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY);
|
m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY);
|
||||||
m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ);
|
m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ);
|
||||||
|
Loading…
Reference in New Issue
Block a user