I'm trying to edit game.cpp making ppl unable to throw stackable items under themselves/others
but there is something wrong
with this one
items can't be thrown under ppl, they can't be worn, either
and when someone puts an item on, it returns the same cancel msg
with this one
items can't be thrown under ppl and when someone puts an item on the server crashes
I'd appreciate it if someone would tell me what i am missing.
but there is something wrong
with this one
Code:
if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
{
player->sendCancelMessage(RET_CANNOTTHROW);
return false;
}
//here
if(toCylinder->getTile()->getCreatureCount() && item->isStackable())
{
player->sendCancelMessage(RET_CANNOTTHROW);
return false;
}
//here
items can't be thrown under ppl, they can't be worn, either
and when someone puts an item on, it returns the same cancel msg
with this one
Code:
if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere))
{
player->sendCancelMessage(RET_CANNOTTHROW);
return false;
}
//here
Tile* toTile = map->getTile(toPos);
if(toTile->getCreatureCount() && item->isStackable())
{
player->sendCancelMessage(RET_CANNOTTHROW);
return false;
}
//here
items can't be thrown under ppl and when someone puts an item on the server crashes
I'd appreciate it if someone would tell me what i am missing.