kick npcs the right way

UbitUmarov [2020-11-09 23:16:35]
kick npcs the right way
Filename
OpenSim/Region/Application/OpenSim.cs
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index a71b710..cb7e057 100755
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -524,11 +524,20 @@ namespace OpenSim
                     presence.Lastname.ToLower().Equals(mainParams[3].ToLower()))
                 {
                     MainConsole.Instance.Output(
-                        String.Format(
                             "Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}",
-                            presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName));
+                            presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName);

-                    // kick client...
+                    if (presence.IsNPC)
+                    {
+                        INPCModule npcmodule = presence.Scene.RequestModuleInterface<INPCModule>();
+                        if (npcmodule != null)
+                        {
+                            npcmodule.DeleteNPC(presence.UUID, presence.Scene);
+                            return;
+                        }
+                    }
+
+                        // kick client...
                     if (alert != null)
                         presence.ControllingClient.Kick(alert);
                     else
ViewGit