summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-06-12 09:10:17 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-06-13 12:45:45 +0200
commit55a11710a6c0f7942f3947711f2050c34782c39d (patch)
tree491b3009324e623236977614e91371a0ea4abac7 /src/script/api
parenta99ac62c1ab816ee48cac85fdf834f9fdc599cb1 (diff)
downloadopenttd-55a11710a6c0f7942f3947711f2050c34782c39d.tar.xz
Codechange: convert printf DEBUG statements to fmt Debug statements
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_list.cpp4
-rw-r--r--src/script/api/script_log.cpp2
-rw-r--r--src/script/api/script_log.hpp2
-rw-r--r--src/script/api/script_object.cpp4
-rw-r--r--src/script/api/script_order.cpp2
-rw-r--r--src/script/api/script_rail.cpp2
6 files changed, 8 insertions, 8 deletions
diff --git a/src/script/api/script_list.cpp b/src/script/api/script_list.cpp
index 4d8b39ea1..1985cdbfb 100644
--- a/src/script/api/script_list.cpp
+++ b/src/script/api/script_list.cpp
@@ -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();
diff --git a/src/script/api/script_log.cpp b/src/script/api/script_log.cpp
index 38a9a87d9..63c4548aa 100644
--- a/src/script/api/script_log.cpp
+++ b/src/script/api/script_log.cpp
@@ -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());
}
diff --git a/src/script/api/script_log.hpp b/src/script/api/script_log.hpp
index a71e09c2e..b6767d3f8 100644
--- a/src/script/api/script_log.hpp
+++ b/src/script/api/script_log.hpp
@@ -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
*/
diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp
index 208e0d8e8..1e20b55ed 100644
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -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;
diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp
index b7bcde730..ce0ee76de 100644
--- a/src/script/api/script_order.cpp
+++ b/src/script/api/script_order.cpp
@@ -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);
diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp
index 01916c8c5..8668906c2 100644
--- a/src/script/api/script_rail.cpp
+++ b/src/script/api/script_rail.cpp
@@ -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;