Skip to content

Commit

Permalink
-Crash fix: Bots with a repairable item in it's inventory but 0 money.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Oct 10, 2024
1 parent 8410b03 commit 9e74de6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion playerbot/strategy/values/MaintenanceValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool ShouldAHSellValue::Calculate()
uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)];
uint32 costs = uint32(maxDurability * dmultiplier * double(dQualitymodEntry->quality_mod));

if ((costs * 100) / bot->GetMoney() <= 1) //Would repairing this item use more than 1% of our current gold?
if (bot->GetMoney() && (costs * 100) / bot->GetMoney() <= 1) //Would repairing this item use more than 1% of our current gold?
continue;

ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", ItemQualifier(item).GetQualifier());
Expand Down

0 comments on commit 9e74de6

Please sign in to comment.