MQ2-20130716.zip - PCONTENTS missing ItemSlot

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by dewey2461 » Tue Jul 16, 2013 10:32 pm

Thanks for the quick zip!

PCONTENTS missing ItemSlot.

Looking for my old source to see if I can guess where it might be lurking.

Gomer
a snow griffon
a snow griffon
Posts: 304
Joined: Fri Apr 15, 2005 2:38 pm

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by Gomer » Wed Jul 17, 2013 12:07 am

Old (ieatacid) looks like this:

Code: Select all

/*0x090*/   struct  _CONTENTSARRAY *pContentsArray;
/*0x094*/   DWORD   NumOfSlots2;
/*0x098*/   DWORD   NumOfSlots3;
/*0x09c*/   BYTE    Unknown0x9c[0x2];
/*0x09e*/   WORD    ItemSlot;           //invslot/which bag its in
/*0x0a0*/   WORD    ItemSlot2;          //bagslot if in bag, if on cursr this is FFFF
/*0x0a2*/   BYTE    Unknown0xa2[0x2e];
/*0x0d0*/   BYTE    EvolvingExpOn;
New (EQMule) looks like this:

Code: Select all

/*0x0058*/ struct _CONTENTSARRAY*        pContentsArray;
/*0x005c*/ DWORD        NumOfSlots2;
/*0x0060*/ BYTE         Unknown0x0060[0x28];
/*0x0088*/ DOUBLE       EvolvingExpPct;
/*0x0090*/ BYTE         Unknown0x0088[0x1c];
/*0x00ac*/ DWORD        Price;
/*0x00b0*/ BYTE         Unknown0x00b0[0x24];
/*0x00d4*/ BYTE         EvolvingExpOn;
The EQMule zip doesn't build at all for me under VS2012 express while ieatacid's zips do just fine. I ended up just figuring out which files are updated and only copying those over.

desgn
a lesser mummy
a lesser mummy
Posts: 30
Joined: Mon Mar 18, 2013 9:10 pm

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by desgn » Wed Jul 17, 2013 12:18 am

Here is a fix for it.

Code: Select all

// actual size 0x158 for eqgame.exe dated july 15 2013 - eqmule
typedef struct _CONTENTS {
/*0x0000*/ void*        vtable;
/*0x0004*/ DWORD        ItemType;           // ? 1 = normal, 2 = pack ?
/*0x0008*/ void*        punknown;
/*0x000c*/ BYTE         Unknown0x000c[0x38];
/*0x0044*/ DWORD        MerchantQuantity;
/*0x0048*/ BYTE         Unknown0x0048[0x8];
/*0x0050*/ DWORD        NumOfSlots1;
/*0x0054*/ BYTE         Unknown0x0054[0x4];
/*0x0058*/ struct _CONTENTSARRAY*        pContentsArray;
/*0x005c*/ DWORD        NumOfSlots2;
/*0x0060*/ BYTE         Unknown0x0060[0x6];
/*0x0066*/ WORD         ItemSlot;           // Inventory slot id
/*0x0068*/ WORD         ItemSlot2;          // Bag slot id, starts at 0 for first slot in bag, or FFFF if item is on cursor
/*0x006a*/ BYTE         Unknown0x006a[0x1e];
/*0x0088*/ DOUBLE       EvolvingExpPct;
/*0x0090*/ BYTE         Unknown0x0088[0x1c];
/*0x00ac*/ DWORD        Price;
/*0x00b0*/ BYTE         Unknown0x00b0[0x24];
/*0x00d4*/ BYTE         EvolvingExpOn;
/*0x00d5*/ BYTE         Unknown0x00d5[0xb];
/*0x00e0*/ struct _ITEMINFO*     Item1;
/*0x00e4*/ BYTE         Unknown0x00e4[0x4];
/*0x00e8*/ DWORD        StackCount;
/*0x00ec*/ BYTE         Unknown0x00ec[0x14];
/*0x0100*/ DWORD        MerchantSlot;       // slot id on a merchant
/*0x0104*/ BYTE         Unknown0x0104[0x4];
/*0x0108*/ DWORD        Power;
/*0x010c*/ BYTE         Unknown0x010c[0xc];
/*0x0118*/ DWORD        Open;
/*0x011c*/ BYTE         IsEvolvingItem;
/*0x011d*/ BYTE         Unknown0x011d[0x3];
/*0x0120*/ DWORD        Charges;
/*0x0124*/ BYTE         Unknown0x0124[0x4];
/*0x0128*/ DWORD        EvolvingCurrentLevel;
/*0x012c*/ BYTE         Unknown0x012c[0x10];
/*0x013c*/ DWORD        EvolvingMaxLevel;
/*0x0140*/ BYTE         Unknown0x0140[0xc];
/*0x014c*/ struct _ITEMINFO*     Item2;
/*0x0150*/ BYTE    Unknown0x150[0x8];
/*0x0158*/
} CONTENTS, *PCONTENTS;

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by EqMule » Wed Jul 17, 2013 8:45 am

Gomer wrote:The EQMule zip doesn't build at all for me under VS2012 express while ieatacid's zips do just fine. I ended up just figuring out which files are updated and only copying those over.
I have no idea why, im gonna download vs 2012 express today and see for myself.
The zips are created with the makezip.bat so there shouldn't be any diffs.

the previous zips didn't contain a vs2010 sln file though, perhaps if you don't use that one and just open the macroquest2.sln?
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
warlock45
a grimling bloodguard
a grimling bloodguard
Posts: 881
Joined: Sat Oct 06, 2007 8:32 pm

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by warlock45 » Wed Jul 17, 2013 11:03 am

not sure about him but for me a number of the files are using 2010 format. Though with 2012 express I just right click the solution and tell it up update, then rebuild the solution.

Do appreciate your quick work on this though EQMule, much appreciated =)

vsab
a hill giant
a hill giant
Posts: 151
Joined: Fri Nov 04, 2005 7:40 am

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by vsab » Wed Jul 17, 2013 11:07 am

As a matter of interest, why is there an Item1 and Item2? What do they represent in game?

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by EqMule » Wed Jul 17, 2013 1:56 pm

warlock45 wrote:not sure about him but for me a number of the files are using 2010 format.
that is a setting I kept on purpose since the vs2012 runtime libraries doesn't support windows xp, and I know a lot of users are still on that system.
If you are on win 7 and up it wont matter I guess.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by EqMule » Wed Jul 17, 2013 1:58 pm

vsab wrote:As a matter of interest, why is there an Item1 and Item2? What do they represent in game?
its just pointers to the same itemstruct, sometimes item1 is valid other times its item2, I don't know why.

We have a function that checks which one of them that has the valid pointer and just return that one...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

Gnits
a snow griffon
a snow griffon
Posts: 371
Joined: Fri Jun 03, 2005 7:56 pm

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by Gnits » Wed Jul 17, 2013 7:22 pm

EqMule wrote:
vsab wrote:As a matter of interest, why is there an Item1 and Item2? What do they represent in game?
its just pointers to the same itemstruct, sometimes item1 is valid other times its item2, I don't know why.

We have a function that checks which one of them that has the valid pointer and just return that one...
Actually, two things...
1) 0717 does not have ItemSlot and ItemSlot2 as i just checked where they should be in the MQ2Datatypes.h and .cpp
2) ItemSlot and ItemSlot2 are a direct reference to what the new command does for item activation. I have found that it is always accurate. More over if you use both in the command on a worn item, 2 comes back null i think... But regardless, the commandline still works. It seems to be a very accurate reference to items on ones person. Basically it is top slot (worn item or bag) then interior slot in a container or null or something.

Gnits

EDIT: Ok, i am referring to the missing item. I am not sure what this is referring to but it is used in MQ2GearScore.

dewey2461
Contributing Member
Contributing Member
Posts: 1759
Joined: Sun Apr 17, 2005 1:53 am

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by dewey2461 » Wed Jul 17, 2013 9:00 pm

Its been a while since I coded GearScore but I think the ItemSlot field was returning the top level slot the item was in or null / FF on cursor.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by EqMule » Thu Jul 18, 2013 7:15 am

Gnits wrote:
EqMule wrote:
vsab wrote:As a matter of interest, why is there an Item1 and Item2? What do they represent in game?
its just pointers to the same itemstruct, sometimes item1 is valid other times its item2, I don't know why.

We have a function that checks which one of them that has the valid pointer and just return that one...
Actually, two things...
1) 0717 does not have ItemSlot and ItemSlot2 as i just checked where they should be in the MQ2Datatypes.h and .cpp
2) ItemSlot and ItemSlot2 are a direct reference to what the new command does for item activation. I have found that it is always accurate. More over if you use both in the command on a worn item, 2 comes back null i think... But regardless, the commandline still works. It seems to be a very accurate reference to items on ones person. Basically it is top slot (worn item or bag) then interior slot in a container or null or something.

Gnits

EDIT: Ok, i am referring to the missing item. I am not sure what this is referring to but it is used in MQ2GearScore.
I was referring to _ITEMINFO Item1 and Item2 in my answer to vsab, not talking about ItemSlot an ItemSlot2 which btw are in the correct place in the struct posted above.
I'll be implementing some functionality today to actually make use of them to use items inside bags for example.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

vsab
a hill giant
a hill giant
Posts: 151
Joined: Fri Nov 04, 2005 7:40 am

Re: MQ2-20130716.zip - PCONTENTS missing ItemSlot

Post by vsab » Thu Jul 18, 2013 7:19 am

EqMule wrote:
vsab wrote:As a matter of interest, why is there an Item1 and Item2? What do they represent in game?
its just pointers to the same itemstruct, sometimes item1 is valid other times its item2, I don't know why.

We have a function that checks which one of them that has the valid pointer and just return that one...
Thanks, I'm guessing the function in question is:-

Code: Select all

GetItemFromContents()
I've used it, and currently not had a crash (other than my own coding errors...)