mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-19 06:30:49 +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 isExceptionReject = false;
|
||||||
local isLevelOverrideReject = not FOM_IsItemPetLevelCompatible(itemID, petLevel);
|
local isLevelOverrideReject = not FOM_IsItemPetLevelCompatible(itemID, petLevel);
|
||||||
local isQuarantineReject = FOM_IsQuarantined(itemID, petLevel, familyKey);
|
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
|
if (isExceptionReject) then
|
||||||
rejectedByException = rejectedByException + 1;
|
rejectedByException = rejectedByException + 1;
|
||||||
end
|
end
|
||||||
if (isLevelOverrideReject) then
|
if (isLevelOverrideReject or isLevelRuleReject) then
|
||||||
rejectedByLevelOverride = rejectedByLevelOverride + 1;
|
rejectedByLevelOverride = rejectedByLevelOverride + 1;
|
||||||
end
|
end
|
||||||
if (isQuarantineReject) then
|
if (isQuarantineReject) then
|
||||||
@@ -2500,7 +2510,7 @@ function FOM_FlatFoodList()
|
|||||||
unknownLevelCandidates = unknownLevelCandidates + 1;
|
unknownLevelCandidates = unknownLevelCandidates + 1;
|
||||||
end
|
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;
|
compatibleCount = compatibleCount + 1;
|
||||||
local foodQuality = tonumber(foodLevel);
|
local foodQuality = tonumber(foodLevel);
|
||||||
if (foodQuality == nil) then
|
if (foodQuality == nil) then
|
||||||
@@ -2511,7 +2521,7 @@ function FOM_FlatFoodList()
|
|||||||
end
|
end
|
||||||
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});
|
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;
|
overflowCompatibleCount = overflowCompatibleCount + 1;
|
||||||
local overflowQuality = tonumber(foodLevel);
|
local overflowQuality = tonumber(foodLevel);
|
||||||
if (overflowQuality == nil) then
|
if (overflowQuality == nil) then
|
||||||
|
|||||||
Reference in New Issue
Block a user