mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Rewrite stats weight and item score calculation
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "RandomItemMgr.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "StatsWeightCalculator.h"
|
||||
|
||||
ItemUsage ItemUsageValue::Calculate()
|
||||
{
|
||||
@@ -190,7 +191,8 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
|
||||
bool shouldEquip = false;
|
||||
// uint32 statWeight = sRandomItemMgr->GetLiveStatWeight(bot, itemProto->ItemId);
|
||||
float itemScore = PlayerbotFactory::CalculateItemScore(itemProto->ItemId, bot);
|
||||
StatsWeightCalculator calculator(bot);
|
||||
float itemScore = calculator.CalculateItem(itemProto->ItemId);
|
||||
if (itemScore)
|
||||
shouldEquip = true;
|
||||
|
||||
@@ -214,7 +216,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
}
|
||||
|
||||
ItemTemplate const* oldItemProto = oldItem->GetTemplate();
|
||||
float oldScore = PlayerbotFactory::CalculateItemScore(oldItemProto->ItemId, bot);
|
||||
float oldScore = calculator.CalculateItem(oldItemProto->ItemId);
|
||||
if (oldItem)
|
||||
{
|
||||
// uint32 oldStatWeight = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
|
||||
Reference in New Issue
Block a user