mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-27 10:06:17 +00:00
Stop FOM feeding below-minimum-level food to high-level pets
This commit is contained in:
@@ -2483,10 +2483,20 @@ function FOM_FlatFoodList()
|
||||
local isExceptionReject = false;
|
||||
local isLevelOverrideReject = not FOM_IsItemPetLevelCompatible(itemID, petLevel);
|
||||
local isQuarantineReject = FOM_IsQuarantined(itemID, petLevel, familyKey);
|
||||
-- A food whose known level is below the pet's minimum is refused by the
|
||||
-- server ("not high enough"); skip it up front so FOM never keeps
|
||||
-- re-feeding a too-low stack just to free a bag slot.
|
||||
local isLevelRuleReject = false;
|
||||
if (petLevel > 0 and tonumber(foodLevel) ~= nil and type(MTH_FEED_GetDerivedMinFoodLevel) == "function") then
|
||||
local minFoodLevel = MTH_FEED_GetDerivedMinFoodLevel(petLevel);
|
||||
if (minFoodLevel ~= nil and tonumber(foodLevel) < minFoodLevel) then
|
||||
isLevelRuleReject = true;
|
||||
end
|
||||
end
|
||||
if (isExceptionReject) then
|
||||
rejectedByException = rejectedByException + 1;
|
||||
end
|
||||
if (isLevelOverrideReject) then
|
||||
if (isLevelOverrideReject or isLevelRuleReject) then
|
||||
rejectedByLevelOverride = rejectedByLevelOverride + 1;
|
||||
end
|
||||
if (isQuarantineReject) then
|
||||
@@ -2500,7 +2510,7 @@ function FOM_FlatFoodList()
|
||||
unknownLevelCandidates = unknownLevelCandidates + 1;
|
||||
end
|
||||
|
||||
if (isCompatible and not isExceptionReject and not isLevelOverrideReject and not isQuarantineReject) then
|
||||
if (isCompatible and not isExceptionReject and not isLevelOverrideReject and not isQuarantineReject and not isLevelRuleReject) then
|
||||
compatibleCount = compatibleCount + 1;
|
||||
local foodQuality = tonumber(foodLevel);
|
||||
if (foodQuality == nil) then
|
||||
@@ -2511,7 +2521,7 @@ function FOM_FlatFoodList()
|
||||
end
|
||||
end
|
||||
table.insert(foodList, {bag=bagNum, slot=itemNum, link=itemLink, itemId=itemID, count=itemCount, quality=foodQuality, useful=isUseful, temp=FOM_IsTemporaryFood(itemLink), knownLevel=hasKnownLevel});
|
||||
elseif (isAbovePreferredLevel and not isExceptionReject and not isLevelOverrideReject and not isQuarantineReject) then
|
||||
elseif (isAbovePreferredLevel and not isExceptionReject and not isLevelOverrideReject and not isQuarantineReject and not isLevelRuleReject) then
|
||||
overflowCompatibleCount = overflowCompatibleCount + 1;
|
||||
local overflowQuality = tonumber(foodLevel);
|
||||
if (overflowQuality == nil) then
|
||||
|
||||
Reference in New Issue
Block a user