give bag on player death if 790

This commit is contained in:
ErikasKontenis 2020-02-16 19:43:42 +02:00
parent 5f9d23c127
commit a27910e47c
3 changed files with 12 additions and 1 deletions

View File

@ -276,6 +276,8 @@ enum item_t : uint16_t {
ITEM_FULLSPLASH = 2886,
ITEM_SMALLSPLASH = 2889,
ITEM_BAG = 2853,
ITEM_PARCEL = 3503,
ITEM_PARCEL_STAMPED = 3504,
ITEM_LETTER = 3505,

View File

@ -52,7 +52,7 @@ void MonsterType::createLoot(Container* corpse)
return;
}
Item* bagItem = Item::CreateItem(2853, 1);
Item* bagItem = Item::CreateItem(ITEM_BAG, 1);
if (!bagItem) {
return;
}

View File

@ -1599,6 +1599,15 @@ void Player::dropLoot(Container* corpse, Creature*)
}
}
}
if (g_game.getClientVersion() >= CLIENT_VERSION_790) {
if (!inventory[CONST_SLOT_BACKPACK]) {
Item* bagItem = Item::CreateItem(ITEM_BAG, 1);
if (bagItem) {
g_game.internalPlayerAddItem(this, bagItem, false, CONST_SLOT_BACKPACK);
}
}
}
}
void Player::death(Creature* lastHitCreature)