[Bug Fix] Fix Tradeskill Salvage (#1925)

This commit is contained in:
KayenEQ 2022-01-11 18:24:47 -05:00 committed by GitHub
parent f3002d9656
commit d10145fc6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1128,9 +1128,11 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
itr = spec->salvage.begin(); itr = spec->salvage.begin();
uint8 sc = 0; uint8 sc = 0;
while(itr != spec->salvage.end()) { while(itr != spec->salvage.end()) {
for(sc = 0; sc < itr->second; sc++) for (sc = 0; sc < itr->second; sc++) {
if(zone->random.Roll(SalvageChance)) if (zone->random.Roll(SalvageChance)) {
SummonItem(itr->first, 1); SummonItem(itr->first, 1);
}
}
++itr; ++itr;
} }
} }
@ -1403,7 +1405,6 @@ bool ZoneDatabase::GetTradeRecipe(
DBTradeskillRecipe_Struct *spec DBTradeskillRecipe_Struct *spec
) )
{ {
std::string container_where_filter; std::string container_where_filter;
if (some_id == 0) { if (some_id == 0) {
// world combiner so no item number // world combiner so no item number
@ -1529,7 +1530,7 @@ bool ZoneDatabase::GetTradeRecipe(
results = QueryDatabase(query); results = QueryDatabase(query);
if (results.Success()) { if (results.Success()) {
for (auto row = results.begin(); row != results.begin(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
uint32 item = (uint32) atoi(row[0]); uint32 item = (uint32) atoi(row[0]);
uint8 num = (uint8) atoi(row[1]); uint8 num = (uint8) atoi(row[1]);
spec->salvage.push_back(std::pair<uint32, uint8>(item, num)); spec->salvage.push_back(std::pair<uint32, uint8>(item, num));