Hello friends
This error exists in some versions and appears sometimes, so I decided to search for the cause of the problem and its solution, and I wanted to share it with you so that everyone can benefit.
cmd_gm.cpp
ACMD(do_advance)
{
char arg1[256], arg2[256];
two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
if (!*arg1 || !*arg2)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Syntax: advance <name> <level>");
return;
}
LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
if (!tch)
{
ch->ChatPacket(CHAT_TYPE_INFO, "%s not exist", arg1);
return;
}
int level = 0;
str_to_number(level, arg2);
tch->SetExp(0); // Fix level
tch->ResetPoint(MINMAX(0, level, gPlayerMaxLevel));
}
ACMD(do_level)
{
char arg2[256];
one_argument(argument, arg2, sizeof(arg2));
if (!*arg2)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Syntax: level <level>");
return;
}
int level = 0;
str_to_number(level, arg2);
ch->SetExp(0); // Fix level
ch->ResetPoint(MINMAX(1, level, gPlayerMaxLevel));
ch->ClearSkill();
ch->ClearSubSkill();
}
Hope it helps someone.. Goodbye