mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
mantis 7952: kill npc if health gone (original patch by Mandarinka Tasty with small change)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user