mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Warnings] Fix warnings
This commit is contained in:
@@ -3123,7 +3123,7 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType)
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
inline int strcmpi(char const* s1, char const* s2)
|
inline int strcmpi(char const* s1, char const* s2)
|
||||||
{
|
{
|
||||||
for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2);
|
for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2) {}
|
||||||
return *s1 - *s2;
|
return *s1 - *s2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -3951,6 +3951,8 @@ std::string const PlayerbotAI::HandleRemoteCommand(std::string const command)
|
|||||||
case NeedMoneyFor::guild:
|
case NeedMoneyFor::guild:
|
||||||
out << "guild";
|
out << "guild";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
out << " | " << ChatHelper::formatMoney(AI_VALUE2(uint32, "free money for", i)) << " / " << ChatHelper::formatMoney(AI_VALUE2(uint32, "money needed for", i)) << "\n";
|
out << " | " << ChatHelper::formatMoney(AI_VALUE2(uint32, "free money for", i)) << " / " << ChatHelper::formatMoney(AI_VALUE2(uint32, "money needed for", i)) << "\n";
|
||||||
|
|||||||
@@ -1285,7 +1285,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
|
|||||||
"ROUND( position_z / 50), "
|
"ROUND( position_z / 50), "
|
||||||
"t.entry "
|
"t.entry "
|
||||||
"HAVING "
|
"HAVING "
|
||||||
"count(*) > 10) AS g "
|
"count(*) > 7) AS g "
|
||||||
"INNER JOIN creature c ON g.guid = c.guid "
|
"INNER JOIN creature c ON g.guid = c.guid "
|
||||||
"INNER JOIN creature_template t on c.id1 = t.entry "
|
"INNER JOIN creature_template t on c.id1 = t.entry "
|
||||||
"ORDER BY "
|
"ORDER BY "
|
||||||
|
|||||||
@@ -199,8 +199,9 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
|||||||
if (!oldItem)
|
if (!oldItem)
|
||||||
if (shouldEquip)
|
if (shouldEquip)
|
||||||
return ITEM_USAGE_EQUIP;
|
return ITEM_USAGE_EQUIP;
|
||||||
else
|
else {
|
||||||
return ITEM_USAGE_BAD_EQUIP;
|
return ITEM_USAGE_BAD_EQUIP;
|
||||||
|
}
|
||||||
|
|
||||||
ItemTemplate const* oldItemProto = oldItem->GetTemplate();
|
ItemTemplate const* oldItemProto = oldItem->GetTemplate();
|
||||||
float oldScore = PlayerbotFactory::CalculateItemScore(oldItemProto->ItemId, bot);
|
float oldScore = PlayerbotFactory::CalculateItemScore(oldItemProto->ItemId, bot);
|
||||||
@@ -217,8 +218,9 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
|||||||
if (itemProto->Class == ITEM_CLASS_QUIVER)
|
if (itemProto->Class == ITEM_CLASS_QUIVER)
|
||||||
if (!oldItem || oldItemProto->ContainerSlots < itemProto->ContainerSlots)
|
if (!oldItem || oldItemProto->ContainerSlots < itemProto->ContainerSlots)
|
||||||
return ITEM_USAGE_EQUIP;
|
return ITEM_USAGE_EQUIP;
|
||||||
else
|
else {
|
||||||
return ITEM_USAGE_NONE;
|
return ITEM_USAGE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
bool existingShouldEquip = true;
|
bool existingShouldEquip = true;
|
||||||
if (oldItemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), oldItemProto))
|
if (oldItemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), oldItemProto))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class PlayerbotAI;
|
|||||||
class FindPlayerPredicate
|
class FindPlayerPredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~FindPlayerPredicate() = default;
|
||||||
virtual bool Check(Unit* /*unit*/) = 0;
|
virtual bool Check(Unit* /*unit*/) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user