simplify combatmodule npc kill check

This commit is contained in:
UbitUmarov
2021-10-24 21:06:42 +01:00
parent 3db0bf7996
commit 74a0bb3837
2 changed files with 6 additions and 4 deletions

View File

@@ -117,9 +117,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
// string killingAvatarMessage;
// check to see if it is an NPC and just remove it
INPCModule NPCmodule = deadAvatar.Scene.RequestModuleInterface<INPCModule>();
if (NPCmodule != null && NPCmodule.DeleteNPC(deadAvatar.UUID, deadAvatar.Scene))
if(deadAvatar.IsNPC)
{
INPCModule NPCmodule = deadAvatar.Scene.RequestModuleInterface<INPCModule>();
if (NPCmodule != null)
NPCmodule.DeleteNPC(deadAvatar.UUID, deadAvatar.Scene);
return;
}