use player-visible client IDs in $setassist command

This commit is contained in:
Martin Michelsen
2023-12-30 15:20:53 -08:00
parent f54d7b0476
commit 3aaaf0353e
+6 -2
View File
@@ -1785,16 +1785,20 @@ static void server_command_ep3_replace_assist_card(shared_ptr<Client> c, const s
return;
}
uint8_t client_id;
size_t client_id;
string card_name;
if (isdigit(args[0])) {
auto tokens = split(args, ' ', 1);
client_id = stoul(tokens.at(0), nullptr, 0);
client_id = stoul(tokens.at(0), nullptr, 0) - 1;
card_name = tokens.at(1);
} else {
client_id = c->lobby_client_id;
card_name = args;
}
if (client_id >= 4) {
send_text_message(c, "$C6Invalid client ID");
return;
}
shared_ptr<const Episode3::CardIndex::CardEntry> ce;
try {