diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:44:22 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:55:42 +0000 |
commit | 860c270c73048b4930ac8cbebcd60be746eb9782 (patch) | |
tree | a88a8acb208cf426ae8fac05dda202c57b59426a /src/cargopacket.cpp | |
parent | 395a5d9991b500c681ff384f8d3b4e153e687abb (diff) | |
download | openttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz |
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/cargopacket.cpp')
-rw-r--r-- | src/cargopacket.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index 08b72ec46..eafab6880 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -556,8 +556,8 @@ void VehicleCargoList::InvalidateCache() template<VehicleCargoList::MoveToAction Tfrom, VehicleCargoList::MoveToAction Tto> uint VehicleCargoList::Reassign(uint max_move, TileOrStationID) { - assert_compile(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); - assert_compile(Tfrom - Tto == 1 || Tto - Tfrom == 1); + static_assert(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); + static_assert(Tfrom - Tto == 1 || Tto - Tfrom == 1); max_move = min(this->action_counts[Tfrom], max_move); this->action_counts[Tfrom] -= max_move; this->action_counts[Tto] += max_move; |