Crash when GM write /drop 12345123
Fix:
Syntax error in /add cmd
fix:
Fix:
Code:
void ChatDrop(int aIndex,char* text)
{
if (strlen(text)<1)
return;
if (isDropOnlyForGM && !IsGM(aIndex))
{
Print(aIndex,0,g_DropOnlyForGMError);
return;
}
int TYPE = 0;
int INDEX = 0;
int LEVEL = 0;
int LUCK = 0;
int SKILL = 0;
int OPTION = 0;
int EXC = 0;
int ANC = 0;
int ITEMID = 0;
sscanf_s(text,"%d %d %d %d %d %d %d %d",&TYPE,&INDEX,&LEVEL,&LUCK,&SKILL,&OPTION,&EXC,&ANC);
if(TYPE > 15 || TYPE < -1 || INDEX > 160 || INDEX < -1)
{
GCServerMsgStringSend("Maximum Group is 15, index is 160!",aIndex,1);
return;
}
ITEMID = ((TYPE * 512) + INDEX);
if(ITEMID == NULL || LEVEL > 13 || LUCK > 1 || SKILL > 1 || OPTION > 4 || EXC > 63 || ANC > 10)
{
GCServerMsgStringSend("Check your syntax.", aIndex, 1);
GCServerMsgStringSend("/drop GROUP INDEX LEVEL LUCK SKILL OPTION EXC ANC", aIndex, 1);
return;
}
GCServerMsgStringSend("Item created.", aIndex, 1);
ItemSerialCreateSend ( aIndex , gObj[aIndex].MapNumber , (BYTE)gObj[aIndex].X , (BYTE)gObj[aIndex].Y , ITEMID , LEVEL , 0 , LUCK , SKILL , OPTION , -1 , EXC , ANC );
}
Syntax error in /add cmd
fix:
Code:
else if ( memcmp(lpChat->chatmsg,"/add",strlen("/add")) == 0 )
{
ChatAdd(aIndex,&lpChat->chatmsg[5]);
}
Last edited: