Allow station cargo histories to record larger values than 64k

See: #414
This commit is contained in:
Jonathan G Rennison
2022-09-06 23:03:46 +01:00
parent 1d93cd59e7
commit 5a39734a1c
5 changed files with 14 additions and 4 deletions

View File

@@ -59,6 +59,7 @@
#include "tunnelbridge_map.h"
#include "cheat_type.h"
#include "newgrf_roadstop.h"
#include "core/math_func.hpp"
#include "table/strings.h"
@@ -475,7 +476,7 @@ void Station::UpdateCargoHistory()
this->station_cargo_history.emplace(this->station_cargo_history.begin() + storage_offset);
}
}
this->station_cargo_history[storage_offset][this->station_cargo_history_offset] = static_cast<uint16>(std::clamp<uint>(amount, (uint)0, (uint)UINT16_MAX));
this->station_cargo_history[storage_offset][this->station_cargo_history_offset] = RXCompressUint(amount);
storage_offset++;
}
this->station_cargo_history_offset++;