mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(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.
This commit is contained in:
parent
f096fd93a5
commit
b14c5fdf74
10
vehicle.c
10
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user