ModernUO/Projects/UOContent/Items/Misc/Corpses
Kamron Batman 29e4ecdb1b
fix: Preserve corpse notoriety across server restart (#2426)
BaseCreatures are deleted on death (Mobile.OnDeath calls Delete for non-players), so after save/restart the corpse's _owner reference resolves to null. CorpseNotoriety gated its entire creature branch on `target.Owner is BaseCreature`, falling through to player-corpse logic once the reference vanished. That made monster corpses turn red (body.IsMonster -> Murderer) and innocent NPC corpses turn grey (null is not PlayerMobile -> CanBeAttacked) on the next restart.

Snapshots the relevant owner state into CorpseFlag at corpse creation: OwnerWasBaseCreature, OwnerWasSummoned, OwnerWasAnimatedDead. Folds the standalone _murderer bool into CorpseFlag.Murderer for consistency with Criminal. CorpseNotoriety now consults the flags so the creature branch stays correct without a live mobile reference.

Bumps Corpse serialization to v16 with a MigrateFrom(V15Content) that maps the old Murderer bool onto the new flag. Pre-fix corpses already on disk decay within 7 minutes; their first post-restart color may be wrong, which is acceptable.

Also documents that the schema generator must be run after every version bump (`dotnet tool run ModernUOSchemaGenerator -- ModernUO.slnx`) since `dotnet build` does not emit migration JSON files.
2026-05-03 02:15:01 -07:00
..
Corpse.cs fix: Preserve corpse notoriety across server restart (#2426) 2026-05-03 02:15:01 -07:00
CorpseNameAttribute.cs fix: Codegens corpses (#1287) 2022-11-28 23:08:38 -08:00
CorpsePackets.cs fix: Bumps deps. Updates copyrights (#2353) 2026-03-05 19:36:54 -08:00
DecayedCorpse.cs fix: Codegens corpses (#1287) 2022-11-28 23:08:38 -08:00