Code: Select all
if (pSpellSlot->spellstate != 0) {
strcpy(szTemp,"-2");
} else {Thanks
GrimJack
Moderator: MacroQuest Developers
Code: Select all
if (pSpellSlot->spellstate != 0) {
strcpy(szTemp,"-2");
} else {I'm using the "Fix" from that post. Gem 1-7 works fine. It's gem 8 that is the problem now.
Good point. I have whatever is in the current CVS. I'll remove the [sp+1] fix and see if both are in cvs.Plazmic wrote:do you have both the temporary fix [sp+1] and the real (struct) fix?
That would bust slot 8
Code: Select all
} else if (!strncmp("char(gem,",szVar,9)) {
if (!strstr(szVar,")")) {
DebugSpew("PMP - Bad $char() '%s'",szVar);
return PMP_ERROR_BADPARM;
} else {
PEQCASTSPELLWINDOW pCastSpellWindow = NULL;
PEQCASTSPELLWINDOW pSpellSlot = NULL;
pCastSpellWindow = (PEQCASTSPELLWINDOW)*EQADDR_CLASSCASTSPELLWND;
i += (strstr(szVar,")")-szVar);
CHAR szTemp[MAX_STRING] = "0";
PCHAR szArg = szVar+9;
WORD Gem = atoi(szArg);
if (Gem==0 && szArg[0]!='0') {
if (szArg[0]=='"') szArg++;
DWORD sp;
[color=RED] for (sp=1;sp<9;sp++) {
if (pCharInfo->MemorizedSpells[sp-1] != 0xFFFFFFFF) {
PCHAR SpellName = GetSpellByID(pCharInfo->MemorizedSpells[sp-1]);
if (!strnicmp(szArg,SpellName,strlen(SpellName))) {
if (!EQADDR_CLASSCASTSPELLWND) {
strcpy(szTemp,"0");
} else {
pSpellSlot = (PEQCASTSPELLWINDOW)pCastSpellWindow->SpellSlots[sp];
if (pSpellSlot->spellstate == 0) {
itoa(sp,szTemp,10);
} else {
strcpy(szTemp,"-2");
}
}
}
}
}[/color]
} else {
if (Gem>0 && Gem<9) {
if (pCharInfo->MemorizedSpells[Gem-1] != 0xFFFFFFFF) {
strcpy(szTemp,GetSpellByID(pCharInfo->MemorizedSpells[Gem-1]));
} else {
strcpy(szTemp,"NULL");
}
} else {
strcpy(szTemp,"NULL");
}
}
strcat(szOutput,szTemp);
}That would bust slot 1. All you have to do is remove the [sp+1] fix. Right now the fixed structure AND the [sp+1] fix are in CVS.pooz wrote:There seems to be some confusion about how to number the spell gems
in that one function there's two different numberings
MemorizedSpells uses the 0 to 7 numbering
SpellSlots uses the 1 to 8 numbering
Anyway, try this and see if it works
Code: Select all
} else if (!strncmp("char(gem,",szVar,9)) { if (!strstr(szVar,")")) { DebugSpew("PMP - Bad $char() '%s'",szVar); return PMP_ERROR_BADPARM; } else { PEQCASTSPELLWINDOW pCastSpellWindow = NULL; PEQCASTSPELLWINDOW pSpellSlot = NULL; pCastSpellWindow = (PEQCASTSPELLWINDOW)*EQADDR_CLASSCASTSPELLWND; i += (strstr(szVar,")")-szVar); CHAR szTemp[MAX_STRING] = "0"; PCHAR szArg = szVar+9; WORD Gem = atoi(szArg); if (Gem==0 && szArg[0]!='0') { if (szArg[0]=='"') szArg++; DWORD sp; [color=RED] for (sp=1;sp<9;sp++) { if (pCharInfo->MemorizedSpells[sp-1] != 0xFFFFFFFF) { PCHAR SpellName = GetSpellByID(pCharInfo->MemorizedSpells[sp-1]); if (!strnicmp(szArg,SpellName,strlen(SpellName))) { if (!EQADDR_CLASSCASTSPELLWND) { strcpy(szTemp,"0"); } else { pSpellSlot = (PEQCASTSPELLWINDOW)pCastSpellWindow->SpellSlots[sp]; if (pSpellSlot->spellstate == 0) { itoa(sp,szTemp,10); } else { strcpy(szTemp,"-2"); } } } } }[/color] } else { if (Gem>0 && Gem<9) { if (pCharInfo->MemorizedSpells[Gem-1] != 0xFFFFFFFF) { strcpy(szTemp,GetSpellByID(pCharInfo->MemorizedSpells[Gem-1])); } else { strcpy(szTemp,"NULL"); } } else { strcpy(szTemp,"NULL"); } } strcat(szOutput,szTemp); }
Code: Select all
if (pCharInfo->MemorizedSpells[sp] != 0xFFFFFFFF) {