Gicu
Well-Known Member
- Joined
- Feb 26, 2011
- Messages
- 187
- Reaction score
- 52
actions.cpp
I click on corpse and send auto loot items to player BUT if player have no backpack or backpack slots item disappears.
1. I need check if player no have free space/slots in backpacks then script stop and write message. Cap is ok.
2. No check player backpacks! Only corpse monster
I click on corpse and send auto loot items to player BUT if player have no backpack or backpack slots item disappears.
if (player->autoLootList.size() != 0) {
if (player->getCapacity() > 100 * 100) { //Minimum of Capacity for autoloot works. (100 CAP)
for (Item* item : container->getItemList()) {
if (player->getItemFromAutoLoot(item->getID())) {
std:stringstream msgAutoLoot;
msgAutoLoot << "You looted a " << item->getItemCount() << "x " << item->getName() << ".";
g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr);
//player->sendChannelMessage(9, TALKTYPE_CHANNEL_Y, msgAutoLoot.str());
player->sendChannelMessage("[Auto Loot]", msgAutoLoot.str(), TALKTYPE_CHANNEL_O, 9);
}
}
} else {
player->sendTextMessage(MESSAGE_INFO_DESCR, "Sorry, you don't have enough capacity to use auto loot, so it has been disabled. (100+ capacity is required)");
player->sendChannelMessage("[Auto Loot]", "Sorry, you don't have enough capacity to use auto loot, so it has been disabled. (100+ capacity is required)", TALKTYPE_CHANNEL_O, 9);
}
}
1. I need check if player no have free space/slots in backpacks then script stop and write message. Cap is ok.
2. No check player backpacks! Only corpse monster
Last edited: