adrian alvarez
Member
- Joined
- Mar 7, 2017
- Messages
- 46
- Solutions
- 1
- Reaction score
- 6
no work on otservbr 1.3
nvm, ill testu need have certain of what version u are using.
Idk why u got debug if u using tfs 1.x and make everything like a post...
uint32_t corpseOwner = container->getCorpseOwner();
if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) {
return RETURNVALUE_YOUARENOTTHEOWNER;
} else {
if (player->canOpenCorpse(corpseOwner) && 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::ostringstream msgAutoLoot;
msgAutoLoot << "You looted a " << item->getItemCount() << "x " << item->getName() << ".";
g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr);
player->sendTextMessage(MESSAGE_INFO_DESCR, msgAutoLoot.str());
}
}
} 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)");
}
}
}
//load storage map
if ((result = db.storeQuery(fmt::format("SELECT `key`, `value` FROM `player_storage` WHERE `player_id` = {:d}", player->getGUID())))) {
do {
player->addStorageValue(result->getNumber<uint32_t>("key"), result->getNumber<int32_t>("value"), true);
} while (result->next());
}
query.str(std::string());
query << "SELECT `autoloot_list` FROM `player_autoloot` WHERE `player_id` = " << player->getGUID();
if ((result = db.storeQuery(query.str()))) {
unsigned long lootlistSize;
const char* autolootlist = result->getStream("autoloot_list", lootlistSize);
PropStream propStreamList;
propStreamList.init(autolootlist, lootlistSize);
int16_t value;
int16_t item = propStreamList.read<int16_t>(value);
while (item) {
player->addItemToAutoLoot(value);
item = propStreamList.read<int16_t>(value);
}
}
Hello.
Using TFS 1.4.2
I got this error while compiling. Im sure I followed the guide 100% and replaced what was needed.
actions.cpp
C++:uint32_t corpseOwner = container->getCorpseOwner(); if (corpseOwner != 0 && !player->canOpenCorpse(corpseOwner)) { return RETURNVALUE_YOUARENOTTHEOWNER; } else { if (player->canOpenCorpse(corpseOwner) && 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::ostringstream msgAutoLoot; msgAutoLoot << "You looted a " << item->getItemCount() << "x " << item->getName() << "."; g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr); player->sendTextMessage(MESSAGE_INFO_DESCR, msgAutoLoot.str()); } } } 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)"); } } }
iologindata.cpp
C++://load storage map if ((result = db.storeQuery(fmt::format("SELECT `key`, `value` FROM `player_storage` WHERE `player_id` = {:d}", player->getGUID())))) { do { player->addStorageValue(result->getNumber<uint32_t>("key"), result->getNumber<int32_t>("value"), true); } while (result->next()); } query.str(std::string()); query << "SELECT `autoloot_list` FROM `player_autoloot` WHERE `player_id` = " << player->getGUID(); if ((result = db.storeQuery(query.str()))) { unsigned long lootlistSize; const char* autolootlist = result->getStream("autoloot_list", lootlistSize); PropStream propStreamList; propStreamList.init(autolootlist, lootlistSize); int16_t value; int16_t item = propStreamList.read<int16_t>(value); while (item) { player->addItemToAutoLoot(value); item = propStreamList.read<int16_t>(value); } }
View attachment 72847
change query.str(std::string());
to
std::ostringstream query;