diff --git a/Archipelago.cpp b/Archipelago.cpp index d057182..acdf087 100644 --- a/Archipelago.cpp +++ b/Archipelago.cpp @@ -56,7 +56,7 @@ std::map, std::string> map_item_id_name; // Callback function pointers void (*resetItemValues)(); -void (*getitemfunc)(int64_t,bool); +void (*getitemfunc)(int64_t,int,bool); void (*checklocfunc)(int64_t); void (*locinfofunc)(std::vector) = nullptr; void (*recvdeath)() = nullptr; @@ -324,7 +324,7 @@ void AP_SetItemClearCallback(void (*f_itemclr)()) { resetItemValues = f_itemclr; } -void AP_SetItemRecvCallback(void (*f_itemrecv)(int64_t,bool)) { +void AP_SetItemRecvCallback(void (*f_itemrecv)(int64_t,int,bool)) { getitemfunc = f_itemrecv; } @@ -739,10 +739,10 @@ bool parse_response(std::string msg, std::string &request) { for (unsigned int j = 0; j < root[i]["items"].size(); j++) { int64_t item_id = root[i]["items"][j]["item"].asInt64(); notify = (item_idx == 0 && last_item_idx <= j && multiworld) || item_idx != 0; - (*getitemfunc)(item_id, notify); + AP_NetworkPlayer sender = getPlayer(0, root[i]["items"][j]["player"].asInt()); + (*getitemfunc)(item_id, sender.slot, notify); if (queueitemrecvmsg && notify) { AP_ItemRecvMessage* msg = new AP_ItemRecvMessage; - AP_NetworkPlayer sender = getPlayer(0, root[i]["items"][j]["player"].asInt()); msg->type = AP_MessageType::ItemRecv; msg->item = getItemName(ap_game, item_id); msg->sendPlayer = sender.alias; diff --git a/Archipelago.h b/Archipelago.h index 5e5fdbe..d9d1a95 100644 --- a/Archipelago.h +++ b/Archipelago.h @@ -48,8 +48,8 @@ void AP_SetDeathLinkSupported(bool); //Parameter Function must reset local state void AP_SetItemClearCallback(void (*f_itemclr)()); -//Parameter Function must collect item id given with parameter. Secound parameter indicates whether or not to notify player -void AP_SetItemRecvCallback(void (*f_itemrecv)(int64_t,bool)); +//Parameter Function must collect item id given with parameter. Second parameter is the player id that sent that item. Third parameter indicates whether or not to notify player +void AP_SetItemRecvCallback(void (*f_itemrecv)(int64_t,int,bool)); //Parameter Function must mark given location id as checked void AP_SetLocationCheckedCallback(void (*f_locrecv)(int64_t));