line 350 on should look like this in the mq2itemdisplay
Code: Select all
#ifndef ISXEQ
void Comment(PSPAWNINFO pChar, PCHAR szLine)
{
CHAR Arg[MAX_STRING] = {0};
CHAR ItemNo[MAX_STRING] = {0};
CHAR Comment[MAX_STRING] = {0};
CHAR szTemp[MAX_STRING] = {0};
GetArg(Arg,szLine,1);
GetArg(ItemNo,szLine,2);
GetArg(szTemp,szLine,3);
for(int i=4;strlen(szTemp);i++){
strcat(Comment,szTemp);
strcat(Comment," ");
GetArg(szTemp,szLine,i);
}
int itemno = atoi(ItemNo);
if (stricmp(Arg,"add") && stricmp(Arg,"del"))
{
WriteChatColor("Use: /inote <add|del> <itemno> \"Comment\"",CONCOLOR_YELLOW);
return;
}
if (itemno <= 0)
{
WriteChatColor("Invalid item number");
WriteChatColor("Use: /inote <add|del> <itemno> \"Comment\"",CONCOLOR_YELLOW);
return;
}
if (strlen(Comment)==0 || !stricmp(Arg,"del"))
{
sprintf(szTemp,"%07d",itemno);
WritePrivateProfileString("Notes",szTemp,"",INIFileName);
return;
}
if (!stricmp(Arg,"add"))
{
sprintf(szTemp,"%07d",itemno);
WritePrivateProfileString("Notes",szTemp,Comment,INIFileName);
return;
}
}
#endif
// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
DebugSpewAlways("Initializing MQ2ItemDisplay");
// Add commands, macro parameters, hooks, etc.
// EasyClassDetour(CItemDisplayWnd__SetItem,ItemDisplayHook,SetItem_Detour,void,(class EQ_Item *, bool),SetItem_Trampoline);
EzDetour(CItemDisplayWnd__SetItem,ItemDisplayHook::SetItem_Detour,ItemDisplayHook::SetItem_Trampoline);
// EasyClassDetour(CItemDisplayWnd__SetSpell,ItemDisplayHook,SetSpell_Detour,void,(int SpellID,bool HasSpellDescr,int),SetSpell_Trampoline);
EzDetour(CItemDisplayWnd__SetSpell,ItemDisplayHook::SetSpell_Detour,ItemDisplayHook::SetSpell_Trampoline);
#ifndef ISXEQ
AddCommand("/inote",Comment);
#endif
}
// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
DebugSpewAlways("Shutting down MQ2ItemDisplay");
// Remove commands, macro parameters, hooks, etc.
RemoveDetour(CItemDisplayWnd__SetItem);
RemoveDetour(CItemDisplayWnd__SetSpell);
#ifndef ISXEQ
RemoveCommand("/inote");
#endif
}
And Line 149-156 will become this
Code: Select all
#ifndef ISXEQ
GetPrivateProfileString("Notes",temp,"",temp2,MAX_STRING,INIFileName);
if (strlen(temp2)>0)
{
sprintf(temp,"Note: %s<br>",temp2);
strcat(out, temp);
}
#endif
This compiled with 0 errors for me. Will actually check to see if its working now :)