n3crozzy
Member
- Joined
- Apr 23, 2021
- Messages
- 48
- Reaction score
- 14
Hi, what could be wrong? Could someone help me solve this situation by killing a player with a red skull?
The red-skulled player shouldn't lose anything, but let's not go overboard—let them leave a body!
Clean player.cpp file
The red-skulled player shouldn't lose anything, but let's not go overboard—let them leave a body!

Clean player.cpp file
LUA:
bool Player::onDeath()
{
Item *preventLoss = NULL, *preventDrop = NULL;
if(getZone() == ZONE_HARDCORE)
{
setDropLoot(LOOT_DROP_NONE);
setLossSkill(false);
}
else if(skull < SKULL_RED)
{
Item* item = NULL;
for(int32_t i = SLOT_FIRST; ((!preventDrop || !preventLoss) && i < SLOT_LAST); ++i)
{
if(!(item = getInventoryItem((slots_t)i)) || item->isRemoved() ||
(g_moveEvents->hasEquipEvent(item) && !isItemAbilityEnabled((slots_t)i)))
continue;
const ItemType& it = Item::items[item->getID()];
if(!it.hasAbilities())
continue;
if(lootDrop == LOOT_DROP_FULL && it.abilities->preventDrop)
{
setDropLoot(LOOT_DROP_PREVENT);
preventDrop = item;
}
if(skillLoss && !preventLoss && it.abilities->preventLoss)
preventLoss = item;
}
}
LUA:
if(!Creature::onDeath())
{
if(preventDrop)
setDropLoot(LOOT_DROP_FULL);
return false;
}