A listed player can be taken off the market again

transfer.submit {action: withdraw, playerId} ends the manager's own list
entry as it ends without a buyer. The transfer market's first button does
it for a listed player.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-17 14:02:17 +01:00
1 parent ce8b871202
commit 1ec8295c84
9 files changed
+85 -4

No files matched your search

+11 -1
View File
@@ -10710,6 +10710,16 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
if (!listed_result) { restore(); return refuse("transfer_refused", error); }
if(listed_result->status!=TransferActionStatus::accepted) {restore();return refuse("listing_refused","Der Spieler konnte nicht auf die Transferliste gesetzt werden.");}
feedback = loan ? "Der Spieler wird zum Verleih angeboten." : "Der Spieler steht auf der Transferliste.";
} else if (action == "withdraw") {
// {action: "withdraw", playerId}: a listed player of the manager's club leaves the list again
const std::string id = ui_text(*payload, "playerId");
const auto item = std::find_if(m.squad.begin(), m.squad.end(), [&](const auto& s) { return modern::ui_player_id(g_, s.player) == id; });
if (item == m.squad.end()) return refuse("unknown_player", "Spieler nicht im Kader: " + id);
if (transfer_offer_editor_) return refuse("decision_pending", "Bitte das offene Angebot zuerst abschließen.");
const auto status = modern::withdraw_manager_player(g_, manager, item->player).status;
if (status == TransferActionStatus::rejected) return refuse("bid_waiting", "Ein Mitspieler hat für diesen Spieler geboten.");
if (status != TransferActionStatus::accepted) return refuse("not_listed", "Der Spieler steht nicht auf der Transferliste.");
feedback = "Der Spieler ist vom Markt genommen.";
} else if (action == "bid") {
int entry = -1;
if (std::sscanf(ui_text(*payload, "listingId").c_str(), "listing:%d", &entry) != 1) return refuse("unknown_listing", "listingId fehlt.");
@@ -10893,7 +10903,7 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
}
}
} else {
return refuse("invalid_payload", "action ist list, bid, poach, poachOffer oder poachCancel.");
return refuse("invalid_payload", "action ist list, withdraw, bid, poach, poachOffer oder poachCancel.");
}
} catch (const std::exception& ex) {
restore();