A bid on a listed player can be taken back
transfer.submit {action: withdrawBid, listingId} removes the manager's bid
before the seller decides. The orders list of the transfer market does it
with its delete button.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ec8295c84
commit
83bd96c1ff
9 files changed
+77
-4
No files matched your search
@@ -575,6 +575,37 @@ TransferActionResult withdraw_manager_player(ModernState& g, int manager, int pl
|
||||
return out;
|
||||
}
|
||||
|
||||
// OpenBMH deviates from the original: in Modern a manager can take back a bid he made on a listed player.
|
||||
TransferActionResult withdraw_manager_bid(ModernState& g, int manager, int list_entry) {
|
||||
TransferActionResult out;
|
||||
if (manager < 0 || size_t(manager) >= g.manager_teams.size()) {
|
||||
out.status = TransferActionStatus::invalid_manager;
|
||||
return out;
|
||||
}
|
||||
out.status = TransferActionStatus::invalid_request;
|
||||
const int team = g.manager_teams[size_t(manager)];
|
||||
const uint32_t row = ::bmh::layout::EditorList + uint32_t(list_entry) * 0x58;
|
||||
if (team < 0 || team >= league_clubs() || list_entry < 0 || list_entry >= 40 || !g.memory.has(row + 0x57) ||
|
||||
(g.squad_slots.at(modern::transfer_list_slot() + size_t(list_entry)) & 0xfff) == 0xfff) return out;
|
||||
StaticMemory& mem = g.memory;
|
||||
uint32_t bid = 0;
|
||||
while (bid < 4 && mem.u16(row + bid * 2) != uint16_t(team)) ++bid;
|
||||
if (bid == 4) return out;
|
||||
// the bids behind it move up: club, salary, fee, term and the seven bonuses
|
||||
for (uint32_t k = bid; k < 3; ++k) {
|
||||
mem.set16(row + k * 2, mem.u16(row + (k + 1) * 2));
|
||||
mem.set32(row + 0xc + k * 4, mem.u32(row + 0xc + (k + 1) * 4));
|
||||
mem.set32(row + 0x1c + k * 4, mem.u32(row + 0x1c + (k + 1) * 4));
|
||||
mem.set8(row + 0x34 + k, mem.u8(row + 0x34 + k + 1));
|
||||
for (uint32_t b = 0; b < 7; ++b) mem.set8(row + 0x38 + k * 7 + b, mem.u8(row + 0x38 + (k + 1) * 7 + b));
|
||||
}
|
||||
mem.set16(row + 3 * 2, 0xffff);
|
||||
out.status = TransferActionStatus::accepted;
|
||||
out.player = g.squad_slots.at(modern::transfer_list_slot() + size_t(list_entry)) & 0xfff;
|
||||
out.list_entry = list_entry;
|
||||
return out;
|
||||
}
|
||||
|
||||
TransferActionResult list_manager_player(ModernState& g, int manager, int squad_row, WatcomRandom& rand,
|
||||
MinuteReport& report) {
|
||||
TransferActionResult out;
|
||||
|
||||
Reference in new issue
Block a user