reference fix

This commit is contained in:
FinnHornhoover 2021-03-28 15:40:39 -07:00 committed by Gent Semaj
parent 78b17aea72
commit 30de9f668c

View File

@ -790,28 +790,28 @@ void Items::giveMobDrop(CNSocket *sock, Mob* mob, int rolledBoosts, int rolledPo
std::cout << "[WARN] Crate Drop Chance Object " << drop.crateDropChanceId << " was not found" << std::endl; std::cout << "[WARN] Crate Drop Chance Object " << drop.crateDropChanceId << " was not found" << std::endl;
return; return;
} }
CrateDropChance crateDropChance = Items::CrateDropChances[drop.crateDropChanceId]; CrateDropChance& crateDropChance = Items::CrateDropChances[drop.crateDropChanceId];
// sanity check // sanity check
if (Items::CrateDropTypes.find(drop.crateDropTypeId) == Items::CrateDropTypes.end()) { if (Items::CrateDropTypes.find(drop.crateDropTypeId) == Items::CrateDropTypes.end()) {
std::cout << "[WARN] Crate Drop Type Object " << drop.crateDropTypeId << " was not found" << std::endl; std::cout << "[WARN] Crate Drop Type Object " << drop.crateDropTypeId << " was not found" << std::endl;
return; return;
} }
std::vector<int> crateDropType = Items::CrateDropTypes[drop.crateDropTypeId]; std::vector<int>& crateDropType = Items::CrateDropTypes[drop.crateDropTypeId];
// sanity check // sanity check
if (Items::MiscDropChances.find(drop.miscDropChanceId) == Items::MiscDropChances.end()) { if (Items::MiscDropChances.find(drop.miscDropChanceId) == Items::MiscDropChances.end()) {
std::cout << "[WARN] Misc Drop Chance Object " << drop.miscDropChanceId << " was not found" << std::endl; std::cout << "[WARN] Misc Drop Chance Object " << drop.miscDropChanceId << " was not found" << std::endl;
return; return;
} }
MiscDropChance miscDropChance = Items::MiscDropChances[drop.miscDropChanceId]; MiscDropChance& miscDropChance = Items::MiscDropChances[drop.miscDropChanceId];
// sanity check // sanity check
if (Items::MiscDropTypes.find(drop.miscDropTypeId) == Items::MiscDropTypes.end()) { if (Items::MiscDropTypes.find(drop.miscDropTypeId) == Items::MiscDropTypes.end()) {
std::cout << "[WARN] Misc Drop Type Object " << drop.miscDropTypeId << " was not found" << std::endl; std::cout << "[WARN] Misc Drop Type Object " << drop.miscDropTypeId << " was not found" << std::endl;
return; return;
} }
MiscDropType miscDropType = Items::MiscDropTypes[drop.miscDropTypeId]; MiscDropType& miscDropType = Items::MiscDropTypes[drop.miscDropTypeId];
plr->money += miscDropType.taroAmount; plr->money += miscDropType.taroAmount;
// money nano boost // money nano boost