Port two transfer fixes to the Modern core
A new arrival no longer inherits the previous occupant's board flags, and a player who is already listed is not listed a second time (from OpenBMH 1.0.3). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
f2dcf94d2b
commit
8370b5fe60
3 files changed
+15
No files matched your search
@@ -558,6 +558,15 @@ TransferActionResult list_manager_player(ModernState& g, int manager, int squad_
|
||||
out.status = TransferActionStatus::invalid_player;
|
||||
return out;
|
||||
}
|
||||
// Deviates from the original: a player who is already listed is not listed a second time,
|
||||
// and a full list refuses before any random number is drawn.
|
||||
bool free_entry = false;
|
||||
for (size_t entry = 0; entry < 40; ++entry) {
|
||||
const int listed = g.squad_slots.at(modern::transfer_list_slot() + entry) & 0xfff;
|
||||
if (listed == player) { out.status = TransferActionStatus::pending; out.player = player; out.list_entry = int(entry); return out; }
|
||||
free_entry = free_entry || listed == 0xfff;
|
||||
}
|
||||
if (!free_entry) { out.status = TransferActionStatus::blocked_by_board; return out; }
|
||||
if (!modern::list_transfer_player(g, slot, rand, report)) {
|
||||
out.status = report.unsupported ? TransferActionStatus::invalid_request : TransferActionStatus::blocked_by_board;
|
||||
return out;
|
||||
|
||||
Reference in new issue
Block a user