Retire ageing market players without age wrap or duplicate entries (by Codex)

This commit is contained in:
Codex committed 2026-10-30 15:56:46 +01:00
1 parent 3cce6465d0
commit 6b942a2293
7 files changed
+92 -5

No files matched your search

+9 -3
View File
@@ -1104,8 +1104,6 @@ bool release_player(GameState& g, int slot, GameRandom& game, WatcomRandom& rand
return true;
}
namespace {
// CareerSeasonSetup3: the players' new season. Records and boards of the managers restart
// (with new advertising offers, TransferListCountdown2); then every squad and pool slot: players
// out for their career recover now and then with a human club's good doctor, else leave;
@@ -1234,7 +1232,9 @@ void season_players(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteRe
// a year older
p.w368 &= 0xf8003fffu;
int age = int16_t(((p.w364 >> 21) & 0x1f) + 1);
if (s < 0xb70 && rand.range(0x10, 0x16) < age && owner == -1) {
// OpenBMH deviates from the original: includes transfer-market
// players in retirement so the five-bit age cannot wrap to 16.
if (rand.range(0x10, 0x16) < age && owner == -1) {
if (count != 0xff) count = uint8_t(squad_count(g, team, 2) + loans[team]);
if (count > 0xd) {
count--;
@@ -1252,6 +1252,10 @@ void season_players(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteRe
if (std::getenv("BMH_TRACE"))
std::printf(" [release slot %d player %d team %d age %u count %u]\n", s, player, team, (p.w364 >> 21) & 0x1f, count);
if (!release_player(g, s, game, rand, report)) return;
// Club releases compact their squad in remove_from_seller. Pool
// releases have no club: retire this source entry explicitly after
// the regenerated player has been placed in the free-agent pool.
if (team < 0) g.squad_slots.at(size_t(s)) = 0x0fff;
}
}
g.lineups_frozen = false;
@@ -1262,6 +1266,8 @@ void season_players(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteRe
std::fill(g.results.begin(), g.results.end(), uint8_t(0xcc));
}
namespace {
// The end of the CareerSession_RuntimeError_RuntimeField4 branch of DailyInterest: histories beyond 50 seasons shift
// (SeasonEndSteps), the managers' season record starts (ManagerOf(m, 0, -2)), the
// limited game length counts down (CareerDuration), the days pass (DayStepRest) up to the
+4
View File
@@ -187,6 +187,10 @@ void cup_group_overview_effects(GameState& g, int group_index);
// LeagueName: the name of a league below 5 (with its letter, e.g. for the third divisions).
std::string league_name(const GameState& g, int league);
// Season boundary: reset manager boards, age/retire players and clear seasonal
// histories. Kept separate from cup draws, accounts and calendar advancement.
void season_players(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteReport& report);
// MonthChange(absolute squad slot): the player leaves his club for the free agents with new
// values (W and game draws) and an age W(4, 15); his club closes the gap (ReleasePlayer,
// with a human club its tactics board as well). False if the source ownership/state