From e58462a117976c9db240c2f78ce39e89dbffda61 Mon Sep 17 00:00:00 2001 From: 3HMonkey Date: Fri, 3 Jan 2025 18:21:30 +0100 Subject: [PATCH] fix: Fix for decreasing pet loyalty on feed + message (#2050) --- Projects/UOContent/Mobiles/BaseCreature.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Projects/UOContent/Mobiles/BaseCreature.cs b/Projects/UOContent/Mobiles/BaseCreature.cs index 5ba9d01c6..6ce09a0ab 100644 --- a/Projects/UOContent/Mobiles/BaseCreature.cs +++ b/Projects/UOContent/Mobiles/BaseCreature.cs @@ -4312,12 +4312,15 @@ namespace Server.Mobiles } else if (m_Loyalty < MaxLoyalty) { - // 50% chance to increase 10 loyalty per food - m_Loyalty = Math.Min(MaxLoyalty, Utility.CoinFlips(amount, MaxLoyaltyIncrease) * 10); - } + // Calculate the loyalty increase + int loyaltyIncrease = Utility.CoinFlips(amount, MaxLoyaltyIncrease) * 10; - // looks like in OSI pets say they are happier even if they are at maximum loyalty - SayTo(from, 502060); // Your pet looks happier. + if (loyaltyIncrease > 0) // Only update if there's an actual increase + { + m_Loyalty = Math.Min(MaxLoyalty, m_Loyalty + loyaltyIncrease); + SayTo(from, 502060); // Your pet looks happier. + } + } if (Body.IsAnimal) {