From e3fc073742b8feda8b12b77ba37603772aabe199 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Mon, 27 Apr 2015 14:30:02 +0200 Subject: [PATCH] add "gotoentity" command jump to the location of a map entity DOCREF gotoentity --- source/src/editing.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 91d03262..c5b45f9f 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -370,6 +370,21 @@ void restoreposition(block &sel) checkselections(); } +void gotoentity(int *n) +{ + if(noteditmode("gotoentity")) return; + if(ents.inrange(*n) && ents[*n].type != NOTUSED) + { + player1->o.x = ents[*n].x; + player1->o.y = ents[*n].y; + player1->o.z = ents[*n].z; + player1->yaw = (ents[*n].attr1 % 360 + 360) % 360; // works for most ;) + player1->pitch = 0; + player1->resetinterp(); + } +} +COMMAND(gotoentity, "i"); + void editundo() { EDITMP;