Jump to content

[AJUDA] Sistema de Pet Oficial


Marcos
 Share

Recommended Posts

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
root@host:/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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...