Network: Add state checksum which is check in network sync
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "engine_func.h"
|
||||
#include "bridge_signal_map.h"
|
||||
#include "scope_info.h"
|
||||
#include "core/checksum_func.hpp"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/train_cmd.h"
|
||||
@@ -3127,6 +3128,7 @@ static Track ChooseTrainTrack(Train *v, TileIndex tile, DiagDirection enterdir,
|
||||
TileIndex new_tile = res_dest.tile;
|
||||
|
||||
Track next_track = DoTrainPathfind(v, new_tile, dest_enterdir, tracks, path_found, do_track_reservation, &res_dest);
|
||||
UpdateStateChecksum((((uint64) v->index) << 32) | (path_found << 16) | next_track);
|
||||
if (new_tile == tile) best_track = next_track;
|
||||
v->HandlePathfindingResult(path_found);
|
||||
}
|
||||
@@ -4971,6 +4973,7 @@ Money Train::GetRunningCost() const
|
||||
*/
|
||||
bool Train::Tick()
|
||||
{
|
||||
UpdateStateChecksum((((uint64) this->x_pos) << 32) | (this->y_pos << 16) | this->track );
|
||||
if (this->IsFrontEngine()) {
|
||||
if (!(this->vehstatus & VS_STOPPED) || this->cur_speed > 0) this->running_ticks++;
|
||||
|
||||
|
Reference in New Issue
Block a user