Modern: the traffic access has four stages

The Modern interface shows four stages for the traffic access, the original
has three. A Modern world (WorldLayout::traffic_stages = 4) keeps the
condition byte in steps of 64 (64, 128, 192, 255) and offers a build up to
stage 3; every stage weighs as one original stage. New careers convert the
original start table, older Modern saves are converted on load
(traffic_scale). Classic data keeps three stages; the Classic equivalence is
unchanged. Also: the live ticker takes the matches from the desk day on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 09:53:31 +01:00
1 parent fda4b72967
commit 0046ab90d0
18 files changed
+154 -16

No files matched your search

+3 -2
View File
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "formats/executable_layout.hpp"
#include "modern/game/traffic.hpp"
#include "modern/game/modern_state.hpp"
#include "modern/game/matchday_setup.hpp"
#include "game/trace.hpp"
@@ -108,7 +109,7 @@ int32_t catering_income(const ModernState& g, int manager, int32_t spectators, W
for (int k = 0; k < 14; k++) {
const uint8_t v = g.manager_records.at(rec + size_t(k));
if (v == 0) continue;
const uint32_t level = k == 0 ? uint32_t((v - 1) / 0x55 + 1) & 0xFF : 1; // Add32
const uint32_t level = k == 0 ? uint32_t(traffic_stage(v)) & 0xFF : 1; // Add32 (traffic.hpp)
sum += kPerVisitor[k] * uint32_t(spectators) * level / 100;
}
if (sum != 0) sum = uint32_t(rand.range(0x55, 0x73)) * sum / 100;
@@ -724,7 +725,7 @@ int attendance(ModernState& g, int home, int away, int bits, int temperature, in
for (int k = 0; k < 10; k++) {
const int v = r8(size_t(k));
// MatchdaySetupRuntimeField6[0] is overwritten with the step of the stadium size
const int32_t step = k == 0 ? int32_t(v / 0x55 * 25000) : kStadiumSteps[k];
const int32_t step = k == 0 ? int32_t(traffic_full_stages(v) * 25000) : kStadiumSteps[k];
if (step < n && (v == 0 || k == 0)) n -= n / rand.range(10, 20);
}
const int wet = int(uint32_t(100 - covered) * uint32_t(uint8_t(rain)) * 8) / 100;