summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2006-07-11 19:04:50 +0000
committerKUDr <KUDr@openttd.org>2006-07-11 19:04:50 +0000
commite3f40ce8577b061538dab4257d2f81ca757ea5d3 (patch)
treed6ae9e8cc880099f859e6f7bf3f60f3468e40ceb /vehicle.c
parentd2cd50ce7b385fa1c627607aedada3480b2ef197 (diff)
downloadopenttd-e3f40ce8577b061538dab4257d2f81ca757ea5d3.tar.xz
(svn r5483) -Fix: [YAPF] desync - for MP games invalidate YAPF cache on every tick to keep it exactly the same on server and clients (it doesn't fix the real source of the problem, but should solve it). Thanks TrueLight for hunting this bug.
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 988d997cd..b9bca4bfb 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -29,6 +29,8 @@
#include "industry_map.h"
#include "station_map.h"
#include "water_map.h"
+#include "network.h"
+#include "yapf/yapf.h"
#define INVALID_COORD (-0x8000)
#define GEN_HASH(x,y) (((x & 0x1F80)>>7) + ((y & 0xFC0)))
@@ -611,6 +613,14 @@ void CallVehicleTicks(void)
{
Vehicle *v;
+#ifdef ENABLE_NETWORK
+ // hotfix for desync problem:
+ // for MP games invalidate the YAPF cache every tick to keep it exactly the same on the server and all clients
+ if (_networking) {
+ YapfNotifyTrackLayoutChange(0, 0);
+ }
+#endif //ENABLE_NETWORK
+
_first_veh_in_depot_list = NULL; // now we are sure it's initialized at the start of each tick
FOR_ALL_VEHICLES(v) {