Skip to content

Commit

Permalink
fixed online player arrows showing in other rooms in dungeons
Browse files Browse the repository at this point in the history
  • Loading branch information
MelonSpeedruns authored and PurpleHato committed Sep 2, 2023
1 parent 205c2ca commit 336418f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,15 @@ uint8_t Anchor_GetClientScene(uint32_t fairyIndex) {
return GameInteractorAnchor::AnchorClients[clientId].scene;
}

uint8_t Anchor_GetClientRoomIndex(uint32_t fairyIndex) {
uint32_t clientId = GameInteractorAnchor::FairyIndexToClientId[fairyIndex];
if (GameInteractorAnchor::AnchorClients.find(clientId) == GameInteractorAnchor::AnchorClients.end()) {
return 0xFF;
}

return GameInteractorAnchor::AnchorClients[clientId].roomIndex;
}

PlayerData Anchor_GetClientPlayerData(uint32_t puppetIndex) {
uint32_t clientId = GameInteractorAnchor::FairyIndexToClientId[puppetIndex];
if (GameInteractorAnchor::AnchorClients.find(clientId) == GameInteractorAnchor::AnchorClients.end()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void Anchor_RegisterHooks();
void Anchor_PushSaveStateToRemote();
void Anchor_RequestSaveStateFromRemote();
uint8_t Anchor_GetClientScene(uint32_t fairyIndex);
uint8_t Anchor_GetClientRoomIndex(uint32_t fairyIndex);
Vec3s* Anchor_GetClientJointTable(uint32_t puppetIndex);
PlayerData Anchor_GetClientPlayerData(uint32_t puppetIndex);
PosRot Anchor_GetClientPosition(uint32_t fairyIndex);
Expand Down
4 changes: 2 additions & 2 deletions soh/src/code/z_map_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,8 @@ void Minimap_DrawCompassIcons(PlayState* play) {
// Other Anchor Players Arrow
Actor* actor = gPlayState->actorCtx.actorLists[ACTORCAT_ITEMACTION].head;
while (actor != NULL) {
if (gEnLinkPuppetId == actor->id) {
if (actor->world.pos.x != -9999.0) {
if (gEnLinkPuppetId == actor->id && Anchor_GetClientRoomIndex(actor->params - 3) == gPlayState->roomCtx.curRoom.num) {
if (actor->world.pos.x != -9999.0 && Anchor_GetClientScene(actor->params - 3) == gPlayState->sceneNum) {
Color_RGB8 playerColor = Anchor_GetClientColor(actor->params - 3);

tempX = actor->world.pos.x;
Expand Down

0 comments on commit 336418f

Please sign in to comment.