feat(commands): rnpc here stands the NPC a metre in front, facing you (D325)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 8s

At the admin's feet it spawned inside them, looking away (9d player walk). It now
stands 1 m ahead on the ground, turned to face the admin. If something is in the way
at chest height, there is no ground within 2 m below, or a walker would have no
navmesh, it falls back to the admin's own spot and the reply says so.

The harness's cmd.chat.here now checks the metre.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-10-09 00:11:41 -05:00
parent 6b15d68071
commit 246ad17c60
2 changed files with 41 additions and 3 deletions

View File

@@ -1297,7 +1297,9 @@ namespace Oxide.Plugins
permission.GrantUserPermission(uid, "runicnpc.place", null);
RunicNPC.Call("CmdChat", admin, "rnpc", new[] { "here", "t_roam", "count=1" });
JObject chatPlaced = PlacementData("t_roam-2");
Check("cmd.chat.here", chatPlaced != null && Flat(V(chatPlaced["position"].ToObject<Dictionary<string, object>>()), b) < 1f, "" + chatPlaced?.ToString(Formatting.None));
// D325: a metre in front of the admin, not at their feet.
float hereAway = chatPlaced == null ? -1f : Flat(V(chatPlaced["position"].ToObject<Dictionary<string, object>>()), admin.transform.position);
Check("cmd.chat.here", hereAway > 0.8f && hereAway < 1.2f, $"{hereAway:0.00} m from the admin; " + chatPlaced?.ToString(Formatting.None));
RunicNPC.Call("CmdChat", admin, "rnpc", new[] { "respawn", "t_roam-2" });
Check("cmd.chat.adminNeedsAdmin", Row("t_roam-2") != null, "respawn is refused with runicnpc.place alone (no error)");
RunicNPC.Call("CmdChat", admin, "rnpc", new[] { "remove", "t_roam-2" });