add $setassist command

This commit is contained in:
Martin Michelsen
2023-12-30 15:18:42 -08:00
parent 111260cdf3
commit f54d7b0476
6 changed files with 96 additions and 37 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ PlayerState::PlayerState(uint8_t client_id, shared_ptr<Server> server)
void PlayerState::init() {
auto s = this->server();
if (s->player_states[this->client_id].get() != this) {
if (s->player_states.at(this->client_id).get() != this) {
// Note: The original code handles this, but we don't. This appears not to
// ever happen, so we didn't bother implementing it.
throw logic_error("replacing a player state object is not permitted");
@@ -1267,7 +1267,7 @@ bool PlayerState::set_card_from_hand(
return false;
}
auto target_ps = s->player_states[assist_target_client_id];
auto target_ps = s->player_states.at(assist_target_client_id);
if (target_ps) {
uint16_t prev_assist_card_ref = target_ps->card_refs[6];
target_ps->discard_set_assist_card();
@@ -1752,7 +1752,7 @@ void PlayerState::unknown_8023C174() {
this->send_set_card_updates(0);
}
void PlayerState::handle_homesick_assist_effect(shared_ptr<Card> card) {
void PlayerState::handle_homesick_assist_effect_from_bomb(shared_ptr<Card> card) {
if (!card) {
return;
}