Codechange: convert printf DEBUG statements to fmt Debug statements

This commit is contained in:
rubidium42
2021-06-12 09:10:17 +02:00
committed by rubidium42
parent a99ac62c1a
commit 55a11710a6
131 changed files with 601 additions and 601 deletions

View File

@@ -469,7 +469,7 @@ int64 ScriptList::Begin()
int64 ScriptList::Next()
{
if (this->initialized == false) {
DEBUG(script, 0, "Next() is invalid as Begin() is never called");
Debug(script, 0, "Next() is invalid as Begin() is never called");
return 0;
}
return this->sorter->Next();
@@ -483,7 +483,7 @@ bool ScriptList::IsEmpty()
bool ScriptList::IsEnd()
{
if (this->initialized == false) {
DEBUG(script, 0, "IsEnd() is invalid as Begin() is never called");
Debug(script, 0, "IsEnd() is invalid as Begin() is never called");
return true;
}
return this->sorter->IsEnd();

View File

@@ -74,7 +74,7 @@
}
/* Also still print to debug window */
DEBUG(script, level, "[%d] [%c] %s", (uint)ScriptObject::GetRootCompany(), logc, log->lines[log->pos]);
Debug(script, level, "[{}] [{}] {}", (uint)ScriptObject::GetRootCompany(), logc, log->lines[log->pos]);
InvalidateWindowData(WC_AI_DEBUG, 0, ScriptObject::GetRootCompany());
}

View File

@@ -23,7 +23,7 @@ class ScriptLog : public ScriptObject {
public:
/**
* Log levels; The value is also feed to DEBUG() lvl.
* Log levels; The value is also feed to Debug() lvl.
* This has no use for you, as script writer.
* @api -all
*/

View File

@@ -85,7 +85,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
/* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
{
ScriptStorage *s = GetStorage();
DEBUG(script, 6, "SetLastCommand company=%02d tile=%06x p1=%08x p2=%08x cmd=%d", s->root_company, tile, p1, p2, cmd);
Debug(script, 6, "SetLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd);
s->last_tile = tile;
s->last_p1 = p1;
s->last_p2 = p2;
@@ -95,7 +95,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd)
{
ScriptStorage *s = GetStorage();
DEBUG(script, 6, "CheckLastCommand company=%02d tile=%06x p1=%08x p2=%08x cmd=%d", s->root_company, tile, p1, p2, cmd);
Debug(script, 6, "CheckLastCommand company={:02d} tile={:06x} p1={:08x} p2={:08x} cmd={}", s->root_company, tile, p1, p2, cmd);
if (s->last_tile != tile) return false;
if (s->last_p1 != p1) return false;
if (s->last_p2 != p2) return false;

View File

@@ -564,7 +564,7 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance)
/* Make sure we don't go into an infinite loop */
int retry = ScriptObject::GetCallbackVariable(3) - 1;
if (retry < 0) {
DEBUG(script, 0, "Possible infinite loop in SetOrderFlags() detected");
Debug(script, 0, "Possible infinite loop in SetOrderFlags() detected");
return false;
}
ScriptObject::SetCallbackVariable(3, retry);

View File

@@ -195,7 +195,7 @@
int index = 0;
const StationSpec *spec = StationClass::GetByGrf(file->grfid, res, &index);
if (spec == nullptr) {
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
Debug(grf, 1, "{} returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
} else {
/* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */
if (ScriptObject::DoCommand(tile, p1, p2 | spec->cls_id | index << 8, CMD_BUILD_RAIL_STATION)) return true;