CastorFlynn
Member
- Joined
- Aug 29, 2021
- Messages
- 88
- Reaction score
- 8
I would like to click on the corpse and then return who owns it, because I have a bug on reward system and I want to know who are stealing the kill.
C++:
uint32_t corpseOwner = container->getCorpseOwner();
if (container->isRewardCorpse()) {
//only players who participated in the fight can open the corpse
if (player->getGroup()->id >= 4 || player->getAccountType() >= 3) {
return RETURNVALUE_YOUCANTOPENCORPSEADM;
}
if (!player->getReward(container->getIntAttr(ITEM_ATTRIBUTE_DATE), false)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
}
} else if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
}