Me.ActiveDisc always NULL while a disc is running, unless...

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

Mmats
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sat Mar 01, 2008 12:34 pm

Me.ActiveDisc always NULL while a disc is running, unless...

Post by Mmats » Fri Jun 17, 2016 1:28 am

Me.ActiveDisc is always NULL while a disc is running, unless you open the ingame combat abilities window (if it wasnt already open). As soon as you open that window, ActiveDisc starts returning the active disc name as expected. I have only confirmed this on test server, not sure about live.

If you need to run a test in game, do the following -

1. make sure the combat abilities window is closed
2. activate any discipline (preferably one that runs more than a few seconds)
3. /echo ${Me.ActiveDisc}
4. open the combat abilities window (ALT+C)
5. /echo ${Me.ActiveDisc}

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

Re: Me.ActiveDisc always NULL while a disc is running, unles

Post by EqMule » Sun Jun 19, 2016 8:13 pm

Thanks I'll have a look

Mmats
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sat Mar 01, 2008 12:34 pm

Re: Me.ActiveDisc always NULL while a disc is running, unles

Post by Mmats » Mon Jun 27, 2016 11:22 am

Thanks :)

demonstar55
a snow griffon
a snow griffon
Posts: 314
Joined: Fri Nov 28, 2008 6:31 am

Re: Me.ActiveDisc always NULL while a disc is running, unles

Post by demonstar55 » Fri Jul 01, 2016 2:16 pm

So we have this in the client

Code: Select all

#define NUM_BUFF_SLOTS					0x61 //97
#define NUM_LONG_BUFFS                  0x2a //42
#define NUM_SHORT_BUFFS                 0x37 //55

typedef struct _CHARINFO2 {
...
/*0x0064*/ struct _SPELLBUFF    Buff[NUM_LONG_BUFFS];
/*0x0ed4*/ struct _SPELLBUFF    ShortBuff[NUM_SHORT_BUFFS];
...
} CHARINFO2, *PCHARINFO2;
Now you may notice the client has 30 short buffs, but there are 55 here. That's a lot of extra data. Really these arrays are probably a union and it's really 1 array for NPCs server side and split up for clients like this., but the 2nd array isn't entirely just used for songs, the disc also lives in there!

So if we do

Code: Select all

GetCharInfo2()->ShortBuffs[30];
We will find our disc's buff!

This is the same as

Code: Select all

${Me.Song[31]}
Ever since the client changed to a scheme like this, the disc buff has always lived in that array after the usable songs.

I'm not sure the best way to change up the code since the client does seem to use an array of 42 and array of 55 here. Probably should just keep a define for actual number of songs as well and grab the buff from the ShortBuffs[NUM_REAL_SONGS]; or w/e