Skip to content

Commit

Permalink
aegea: Fix slot_player_alias being off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceManiac committed Dec 23, 2024
1 parent c1d726b commit f83baee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion source/aegea/src/aegea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,13 @@ std::string_view ArchipelagoClient::slot_game_name(int slot)

std::string_view ArchipelagoClient::slot_player_alias(int slot)
{
return room_info_["players"][slot]["alias"].getString();
if (slot == 0)
{
// Slot 0 is Archipelago regardless of team.
return "Archipelago";
}
// For now, assume AP teams feature is not in use and slot N is player N.
return room_info_["players"][slot - 1]["alias"].getString();
}

std::string_view ArchipelagoClient::item_name(int64_t item)
Expand Down
4 changes: 2 additions & 2 deletions source/loonyland/loonyArchipelago.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ void UpdateArchipelago()
std::string text = "Got ";
text += ap->item_name(message->item.item);
text += " from ";
text += ap->slot_player_alias(message->slot);
text += ap->slot_player_alias(message->item.player);
NewMessage(text.c_str(), MESSAGE_TIME);
messageCooldown = MESSAGE_TIME;
}
else if (message->slot == ap->player_id())
else if (message->item.player == ap->player_id())
{
// Sent [item] to [player].
std::string text = "Sent ";
Expand Down

0 comments on commit f83baee

Please sign in to comment.