summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-09-07 13:36:18 +0000
committerfrosch <frosch@openttd.org>2014-09-07 13:36:18 +0000
commit937265d6d67d7e96f0144cd5083fe675b14149c5 (patch)
treed3107285c848a8a602ade188c5f9007e064aa62e /src/network
parent08cbf115395ccdc8682b14279f6160fc02d3ec14 (diff)
downloadopenttd-937265d6d67d7e96f0144cd5083fe675b14149c5.tar.xz
(svn r26786) -Fix: Also replay failed commands.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 662f49d17..d9645a595 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -929,10 +929,12 @@ void NetworkGameLoop()
p += 2;
}
- if (strncmp(p, "cmd: ", 5) == 0) {
+ if (strncmp(p, "cmd: ", 5) == 0 || strncmp(p, "cmdf: ", 6) == 0) {
+ p += 5;
+ if (*p == ' ') p++;
cp = CallocT<CommandPacket>(1);
int company;
- int ret = sscanf(p + 5, "%x; %x; %x; %x; %x; %x; %x; \"%[^\"]\"", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, cp->text);
+ int ret = sscanf(p, "%x; %x; %x; %x; %x; %x; %x; \"%[^\"]\"", &next_date, &next_date_fract, &company, &cp->tile, &cp->p1, &cp->p2, &cp->cmd, cp->text);
/* There are 8 pieces of data to read, however the last is a
* string that might or might not exist. Ignore it if that
* string misses because in 99% of the time it's not used. */