diff --git a/source/loonyland/loonyArchipelago.cpp b/source/loonyland/loonyArchipelago.cpp index 603e8fbf..dc15180b 100644 --- a/source/loonyland/loonyArchipelago.cpp +++ b/source/loonyland/loonyArchipelago.cpp @@ -177,19 +177,32 @@ void GivePlayerItem(int64_t item_id, bool loud) } } -void GetLocationScouts(std::vector vec_NetworkItems) +void GetLocationScouts() { world_t world; LoadWorld(&world, "ap.llw"); - for (auto item : vec_NetworkItems) + bool allGood = true; + + for (auto loc : basic_locations) { - locationData loc = basic_locations[item.location - loonyland_base_id]; + if (loc.Name == "Q: Save Halloween Hill") + { + continue; + } + + const ArchipelagoClient::Item* item = ap->item_at_location(loc.ID + loonyland_base_id); + if (item == nullptr) + { + allGood = false; + continue; + } + if (loc.Type == "Pickup") { Map* tempMap = world.map[loc.MapID]; - int item_id = item.item - loonyland_base_id; - if (item.player == ap->player_id()) + int item_id = item->item - loonyland_base_id; + if (item->player == ap->player_id()) { item_id = basic_items.at(item_id); } @@ -201,14 +214,17 @@ void GetLocationScouts(std::vector vec_NetworkItems) } for (auto const& i : loc.chatCodes) { - chat_table[i].updated += ap->item_name(item.item); + chat_table[i].updated += ap->item_name(item->item); } } - SaveWorld(&world, "ap.llw"); - FreeWorld(&world); + if (allGood) + { + locationWait = false; + SaveWorld(&world, "ap.llw"); + } - locationWait = false; + FreeWorld(&world); } void SendCheckedLocPickup(std::string mapName, int mapNum, int x, int y) @@ -221,7 +237,7 @@ void SendCheckedLocPickup(std::string mapName, int mapNum, int x, int y) return; } } - std::cout << "AP ITEM MISS: " << mapName << " " << x << " " << y; + std::cout << "AP ITEM MISS: " << mapName << " " << x << " " << y << std::endl; } void SendCheckedLocQuest(int questVar) @@ -234,7 +250,7 @@ void SendCheckedLocQuest(int questVar) return; } } - std::cout << "AP QUEST MISS: " << questVar; + std::cout << "AP QUEST MISS: " << questVar << std::endl; } void SendCheckedTalkReward(int talkVar) @@ -404,7 +420,10 @@ void UpdateArchipelago() } // Location scouts - // TODO: call GetLocationScouts with result + if (locationWait) + { + GetLocationScouts(); + } // DeathLink if (ap->pop_death_link()) diff --git a/source/loonyland/loonyArchipelagoData.h b/source/loonyland/loonyArchipelagoData.h index f2ed382c..1405b418 100644 --- a/source/loonyland/loonyArchipelagoData.h +++ b/source/loonyland/loonyArchipelagoData.h @@ -98,7 +98,7 @@ static locationData basic_locations[] = { {"Swamp: Mud Path","Pickup",0,"Hallowe {"PolterGuy's Reward","Pickup",50,"Haunted Tower Roof",20,13,37,1,2,"Haunted Tower Roof",{68}}, {"Tower Basement: DoorDoorDoorDoorDoorDoor","Pickup",51,"Haunted Basement",21,20,13,1,2,"Haunted Basement",{}}, {"Abandoned Mine: Shaft","Pickup",52,"Abandoned Mines",22,39,2,1,2,"Abandoned Mines",{}}, -{"Shrine of Bombulus: Prize","Pickup",53,"The Shrine of Bombulus",23,12,3,2,3,"The Shrine Of Bombulus",{}}, +{"Shrine of Bombulus: Prize","Pickup",53,"The Shrine Of Bombulus",23,12,3,2,3,"The Shrine Of Bombulus",{}}, {"Gloomy Cavern: Lockpick","Pickup",54,"A Gloomy Cavern",24,50,44,2,3,"A Gloomy Cavern",{}}, {"Happy Stick: Hidden","Pickup",55,"Happy Stick Woods",25,61,2,5,6,"Happy Stick Woods",{}}, {"Happy Stick: Reward","Pickup",56,"Happy Stick Woods",25,35,34,0,1,"Happy Stick Woods",{}}, diff --git a/source/loonyland/loonyArchipelagoMenu.cpp b/source/loonyland/loonyArchipelagoMenu.cpp index ca66dbb2..d22ca1d5 100644 --- a/source/loonyland/loonyArchipelagoMenu.cpp +++ b/source/loonyland/loonyArchipelagoMenu.cpp @@ -53,6 +53,7 @@ UpdateArchipelagoMenu(int* lastTime, MGLDraw* mgl) dword btn, j; int i; + UpdateArchipelago(); if (*lastTime > TIME_PER_FRAME * 30) *lastTime = TIME_PER_FRAME * 30; @@ -188,7 +189,7 @@ UpdateArchipelagoMenu(int* lastTime, MGLDraw* mgl) printf("DEBUG: Status: %s\n", status.c_str()); } - if (status == "Authenticated") + if (status == "Active") { GetInfoFromAP(); optMode = 4; @@ -296,7 +297,7 @@ void RenderArchipelagoMenu(MGLDraw* mgl) PrintColor(350, 60 + 5 * 30 + 20, ConnectionStatus().c_str(), 7, -10, 0); PrintColor(160, 60 + 6 * 30 + 20, "Scout status:", 7, -10, 0); - if (!locationWait) + if (locationWait) { PrintColor(350, 60 + 6 * 30 + 20, "Waiting", 7, -10, 0); }