summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-14 19:44:25 +0000
committerrubidium <rubidium@openttd.org>2012-01-14 19:44:25 +0000
commit48717ade9cc1e59d07d8b8d6fe4c552b6bf09043 (patch)
tree0700e0053ececa525a464913515f41c590b988b3 /src/command.cpp
parent4870192823cb177ef9fe88f07f267f52acc6d1c1 (diff)
downloadopenttd-48717ade9cc1e59d07d8b8d6fe4c552b6bf09043.tar.xz
(svn r23800) -Codechange: also desync log failed commands
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 5fd62b745..d04fc5ad6 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -651,6 +651,11 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd,
* we bail out here. */
if (res.Failed() || estimate_only ||
(!test_and_exec_can_differ && !CheckCompanyHasMoney(res))) {
+ if (!_networking || _generating_world || (cmd & CMD_NETWORK_COMMAND) != 0) {
+ /* Log the failed command as well. Just to be able to be find
+ * causes of desyncs due to bad command test implementations. */
+ DEBUG(desync, 1, "cmdf: %08x; %02x; %02x; %06x; %08x; %08x; %08x; \"%s\" (%s)", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text, GetCommandName(cmd));
+ }
cur_company.Restore();
return_dcpi(res, false);
}