Block the drop hacks:
Which is correct ?
1
if (pkItemToDrop->AddToGround (GetMapIndex(), pxPos))
{
ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("¶łľîÁř ľĆŔĚĹŰŔş 3şĐ ČÄ »ç¶óÁý´Ď´Ů."));
pkItemToDrop->StartDestroyEvent(30);
ITEM_MANAGER::instance().FlushDelayedSave (pkItemToDrop);
char szHint[32 + 1];
snprintf (szHint, sizeof (szHint), "%s %u %u", pkItemToDrop->GetName(), pkItemToDrop->GetCount(), pkItemToDrop->GetOriginalVnum());
LogManager::instance().ItemLog (this, pkItemToDrop, "DROP", szHint);
LastDropTime = thecore_pulse();
CountDrops++;
}
if (thecore_pulse() > LastDropTime + 25)
{
CountDrops = 0;
}
if (thecore_pulse() < LastDropTime + 25 && CountDrops >= 4)
{
CountDrops = 0;
sys_err("%s[%d] has been disconnected because of drophack using", GetName(), GetPlayerID());
GetDesc()->SetPhase(PHASE_CLOSE);
return false;
}
2
if (pkItemToDrop->AddToGround (GetMapIndex(), pxPos))
{
if (thecore_pulse() > LastDropTime + 25)
{
CountDrops = 0;
}
if (thecore_pulse() < LastDropTime + 25 && CountDrops >= 4)
{
CountDrops = 0;
sys_err("%s[%d] has been disconnected because of drophack using", GetName(), GetPlayerID());
GetDesc()->SetPhase(PHASE_CLOSE);
return false;
}
ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("¶łľîÁř ľĆŔĚĹŰŔş 3şĐ ČÄ »ç¶óÁý´Ď´Ů."));
pkItemToDrop->StartDestroyEvent(30);
ITEM_MANAGER::instance().FlushDelayedSave (pkItemToDrop);
char szHint[32 + 1];
snprintf (szHint, sizeof (szHint), "%s %u %u", pkItemToDrop->GetName(), pkItemToDrop->GetCount(), pkItemToDrop->GetOriginalVnum());
LogManager::instance().ItemLog (this, pkItemToDrop, "DROP", szHint);
LastDropTime = thecore_pulse();
CountDrops++;
}