Page 1 of 1

GetPet()

Posted: Sun May 16, 2004 4:24 pm
by tonio
With latest ( May 14 2004 19:23:36 ) release, I can't use the "GetPet()" function anymore in plugins... getting:

Code: Select all

error LNK2019: unresolved external symbol __imp__GetPet referenced in function _OnIncomingChat
when trying to build.

MQ2Plugin.h (which is being included) includes MQ2Main.h, which does contain the declaration for GetGet()... so it's really very strange. =/

If I try to add the declaration for GetPet() (PSPAWNINFO GetPet(DWORD ID);) to the cpp file, I get an "inconsistent DLL linkage" error.

Edit: smilies

Posted: Sun May 16, 2004 4:57 pm
by Lax
People used that crap in plugins? ;)
Here's how you do it....

Code: Select all

PSPAWNINFO pPet=(PSPAWNINFO)GetSpawnByID(pSpawn->pActorInfo->PetID);

enjoy!

Posted: Sun May 16, 2004 6:08 pm
by tonio
Yeah that's basically the code in the GetPet() function, except the function receives OwnerID as an agument, so needs to call GetSpawnByID() first to get the owner spawn...

Anyway, I'm a dumbass, just noticed "#if 0 / #endif" surrounding the code where GetPet() gets defined... silly me. =)