Marcos Posted December 8, 2017 at 08:07 PM Share Posted December 8, 2017 at 08:07 PM Boa tarde pessoal, eu implementei o Sistema de Pet, tanto o game como o binário, compilaram sem problemas. Fui fazer os testes in game, e reparei que a idade do Pet não altera, andei a pesquisar, e achei aqui mesmo no fórum um update. Mais ao colocar o update na source, está me dando um erro ao compilar o game. o erro é o seguinte: Spoiler [OK] Compilando: cmd_gm.cpp In file included from cmd_gm.cpp:930: New_PetSystem.h: In function 'void do_item_purge(CHARACTER*, const char*, int, int)': New_PetSystem.h:140: error: template argument for 'template<class _T1, class _T2> struct std::pair' uses local type 'do_item_purge(CHARACTER*, const char*, int, int)::CNewPetActor*' New_PetSystem.h:140: error: trying to instantiate 'template<class _T1, class _T2> struct std::pair' New_PetSystem.h:140: error: template argument 5 is invalid cmd_gm.cpp:931: error: invalid use of incomplete type 'struct CNewPetSystem' char.h:22: error: forward declaration of 'struct CNewPetSystem' gmake: *** [OBJDIR/cmd_gm.o] Error 1 [email protected]:/usr/src/mainline/Srcs/Server/game/src # O Update que eu adicionei é o seguinte: Substituir a função: Spoiler ACMD(do_item_purge) { int i; LPITEM item; for (i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i) { if ((item = ch->GetInventoryItem(i))) { ITEM_MANAGER::instance().RemoveItem(item, "PURGE"); ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255); } } for (i = 0; i < DRAGON_SOUL_INVENTORY_MAX_NUM; ++i) { if ((item = ch->GetItem(TItemPos(DRAGON_SOUL_INVENTORY, i )))) { ITEM_MANAGER::instance().RemoveItem(item, "PURGE"); } } } Por está função: Spoiler ACMD(do_item_purge) { #ifdef NEW_PET_SYSTEM #include "New_PetSystem.h" if (ch->GetNewPetSystem()->IsActivePet()) { ch->ChatPacket(CHAT_TYPE_INFO, "O Pet foi recolhido. "); return ; } #endif int i; LPITEM item; for (i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i) { if ((item = ch->GetInventoryItem(i))) { ITEM_MANAGER::instance().RemoveItem(item, "PURGE"); ch->SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255); } } for (i = 0; i < DRAGON_SOUL_INVENTORY_MAX_NUM; ++i) { if ((item = ch->GetItem(TItemPos(DRAGON_SOUL_INVENTORY, i )))) { ITEM_MANAGER::instance().RemoveItem(item, "PURGE"); } } } Estou pesquisando sobre o mesmo mais até agora não encontrei nada a respeito Link to comment Share on other sites More sharing options...
Marcos Posted December 10, 2017 at 04:40 PM Author Share Posted December 10, 2017 at 04:40 PM Up Link to comment Share on other sites More sharing options...
trample Posted December 10, 2017 at 09:18 PM Share Posted December 10, 2017 at 09:18 PM Spoiler New_PetSystem.h:140: error: template argument for 'template<class _T1, class _T2> struct std::pair' uses local type 'do_item_purge(CHARACTER*, const char*, int, int)::CNewPetActor*' olhou esse? Link to comment Share on other sites More sharing options...
Marcos Posted December 10, 2017 at 11:47 PM Author Share Posted December 10, 2017 at 11:47 PM 3 horas atrás, trample disse: Ocultar conteúdo New_PetSystem.h:140: error: template argument for 'template<class _T1, class _T2> struct std::pair' uses local type 'do_item_purge(CHARACTER*, const char*, int, int)::CNewPetActor*' olhou esse? Sim, estou pesquisando ainda, mais por enquanto nd ainda. Com a função normal o game compila normalmente, só aparece esses erros com a substituição da função. Link to comment Share on other sites More sharing options...
trample Posted December 11, 2017 at 12:18 AM Share Posted December 11, 2017 at 12:18 AM New_PetSystem.h tem ? Link to comment Share on other sites More sharing options...
Marcos Posted December 11, 2017 at 12:19 PM Author Share Posted December 11, 2017 at 12:19 PM 12 horas atrás, trample disse: New_PetSystem.h tem ? Sim, não entendo muito, mais pelo erro parece que o código do New_PetSystem.h está incompleto em relacão a essa função. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now