diff --git a/config/scripts.cfg b/config/scripts.cfg index 144a3e3a..6e1262b2 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -95,6 +95,7 @@ looplist [ newent ents clearents ents closestenttype ents + enumentities ents weapon weapons burstshots weapons team teamnames diff --git a/source/src/world.cpp b/source/src/world.cpp index 98b6735c..602c221c 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -418,6 +418,16 @@ void editentity(char **args, int numargs) // index x y z a1 a2 a3 a4 ... } COMMAND(editentity, "v"); +void enumentities(char *type) +{ + vector res; + int t = getlistindex(type, entnames, false, -1); + loopv(ents) if(ents[i].type == t) cvecprintf(res, "%d ", i); + if(!res.length()) res.add('\0'); + else res.last() = '\0'; + result(res.getbuf()); +} +COMMAND(enumentities, "s"); void scalecomp(uchar &c, int intens) {