diff --git a/config/scripts.cfg b/config/scripts.cfg index e2a43f8a..0634a9dc 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -72,6 +72,7 @@ complete demo demos dmo looplist [ listoptions "" newent ents + addentity ents clearents ents closestenttype ents enumentities ents diff --git a/source/src/world.cpp b/source/src/world.cpp index 0f25f2bc..4c16a2d3 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -445,6 +445,18 @@ void deleteentity(char *ns) } COMMAND(deleteentity, "s"); +void addentity(char *what) // type +{ + int type = findtype(what); + if(noteditmode("addentity") || multiplayer(true) || type == NOTUSED) return; + entity e((int)camera1->o.x, (int)camera1->o.y, (int)camera1->o.z, type, 0, 0, 0, 0); + e.spawned = true; + intret(ents.length()); + ents.add(e); + unsavededits++; +} +COMMAND(addentity, "s"); + void editentity(char **args, int numargs) // index x y z a1 a2 a3 a4 ... { string res = "";