Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG
This commit is contained in:
committed by
Alexander Harkness
parent
73689024f0
commit
4727ed2084
@@ -605,7 +605,7 @@ bool cWorld::SetSpawn(double a_X, double a_Y, double a_Z)
|
||||
m_SpawnX = a_X;
|
||||
m_SpawnY = a_Y;
|
||||
m_SpawnZ = a_Z;
|
||||
LOGD("Spawn set at {%f, %f, %f}", m_SpawnX, m_SpawnY, m_SpawnZ);
|
||||
FLOGD("Spawn set at {0}", Vector3d{m_SpawnX, m_SpawnY, m_SpawnZ});
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -695,7 +695,7 @@ void cWorld::GenerateRandomSpawn(int a_MaxSpawnRadius)
|
||||
{
|
||||
SetSpawn(BiomeOffset.x + 0.5, SpawnY, BiomeOffset.z + 0.5);
|
||||
|
||||
LOGINFO("World \"%s\": Generated spawnpoint position at {%.2f, %.2f, %.2f}", m_WorldName, m_SpawnX, m_SpawnY, m_SpawnZ);
|
||||
FLOGINFO("World \"{0}\": Generated spawnpoint position at {1:.2f}", m_WorldName, Vector3d{m_SpawnX, m_SpawnY, m_SpawnZ});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -729,14 +729,14 @@ void cWorld::GenerateRandomSpawn(int a_MaxSpawnRadius)
|
||||
cChunkDef::BlockToChunk(static_cast<int>(m_SpawnX), static_cast<int>(m_SpawnZ), ChunkX, ChunkZ);
|
||||
cSpawnPrepare::PrepareChunks(*this, ChunkX, ChunkZ, a_MaxSpawnRadius);
|
||||
|
||||
LOGINFO("World \"%s\":Generated spawnpoint position at {%.2f, %.2f, %.2f}", m_WorldName, m_SpawnX, m_SpawnY, m_SpawnZ);
|
||||
FLOGINFO("World \"{0}\":Generated spawnpoint position at {1:.2f}", m_WorldName, Vector3d{m_SpawnX, m_SpawnY, m_SpawnZ});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_SpawnY = GetHeight(static_cast<int>(m_SpawnX), static_cast<int>(m_SpawnZ));
|
||||
LOGWARNING("World \"%s\": Did not find an acceptable spawnpoint. Generated a random spawnpoint position at {%.2f, %.2f, %.2f}", m_WorldName, m_SpawnX, m_SpawnY, m_SpawnZ);
|
||||
FLOGWARNING("World \"{0}\": Did not find an acceptable spawnpoint. Generated a random spawnpoint position at {1:.2f}", m_WorldName, Vector3d{m_SpawnX, m_SpawnY, m_SpawnZ});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user