fix: Skip karma message when karma change is zero (#2710)
## Summary `SendKarmaMessage` maps the karma change to a message, and its fallback arm is "You have lost a little karma." (1019063). A change of `0` lands in that arm, so the player is told they lost karma when nothing changed. How to reproduce on a clean build: kill a creature with 0 karma, such as a grey wolf. The kill awards 0 karma and the player sees "You have lost a little karma." This change returns early when the change is `0`, which matches how `AwardFame` already handles fame: it sends nothing when fame doesn't change. ## Test plan - [x] `dotnet build` succeeds - [x] Kill a 0-karma creature: no karma message - [x] Kill a negative-karma creature: "gained karma" message is unchanged
This commit is contained in:
parent
6ce2b47703
commit
6b411944b3
1 changed files with 5 additions and 0 deletions
|
|
@ -262,6 +262,11 @@ namespace Server.Misc
|
|||
|
||||
private static void SendKarmaMessage(Mobile m, int offset)
|
||||
{
|
||||
if (offset == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var message = offset switch
|
||||
{
|
||||
> 40 => 1019062, // You have gained a lot of karma.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue