mantis 7952: kill npc if health gone (original patch by Mandarinka Tasty with small change)

This commit is contained in:
UbitUmarov
2021-10-24 21:03:55 +01:00
parent 3f3a5da3a9
commit 3db0bf7996

View File

@@ -3852,6 +3852,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
presence.setHealthWithUpdate(health);
if (health <= 0)
{
// check to see if it is an NPC and just remove it
if (presence.IsNPC)
{
INPCModule NPCmodule = World.RequestModuleInterface<INPCModule>();
if (NPCmodule != null)
NPCmodule.DeleteNPC(presence.UUID, World);
return;
}
float healthliveagain = 100;
presence.ControllingClient.SendAgentAlertMessage("You died!", true);
presence.setHealthWithUpdate(healthliveagain);