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:
Jascen 2026-10-17 16:55:17 -04:00 • committed by GitHub
parent 6ce2b47703
commit 6b411944b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.