]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/target/spawn.qc
improve descriptions, add missing cvar to config
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / target / spawn.qc
index eced856d7ecfcf331d18a49a225b28083a95c626..1464da95511260b8ce4592e705b50bf9a62e7c2d 100644 (file)
@@ -1,3 +1,4 @@
+#include "spawn.qh"
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
@@ -54,7 +55,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                        data = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", key)));
                        if(data.y == 0) // undefined field, i.e., invalid type
                        {
-                               LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
+                               LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!");
                                continue;
                        }
                }
@@ -149,7 +150,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                }
                                else
                                {
-                                       LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
+                                       LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!");
                                        continue;
                                }
 
@@ -162,13 +163,13 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                {
                                        if(value != "")
                                        {
-                                               LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!\n");
+                                               LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!");
                                                continue;
                                        }
                                        data2 = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", valuefield)));
                                        if(data2_y == 0) // undefined field, i.e., invalid type
                                        {
-                                               LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
+                                               LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!");
                                                continue;
                                        }
                                        value = getentityfieldstring(data2_x, valueent);
@@ -188,7 +189,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                                        value = vtos(stov(value) + stov(valueoffset));
                                                        break;
                                                default:
-                                                       LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!");
                                                        break;
                                        }
                                }
@@ -205,7 +206,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                                        value = vtos(stov(value) + random() * data2_x * '1 0 0' + random() * data2_y * '0 1 0' + random() * data2_z * '0 0 1');
                                                        break;
                                                default:
-                                                       LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
+                                                       LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!");
                                                        break;
                                        }
                                }
@@ -287,8 +288,10 @@ void target_spawn_use(entity this, entity actor, entity trigger)
        else
        {
                // edit entity
-               for(entity e = NULL; (e = find(e, targetname, this.target)); )
-                       target_spawn_useon(e, this, actor, trigger);
+               FOREACH_ENTITY_STRING(targetname, this.target,
+               {
+                       target_spawn_useon(it, this, actor, trigger);
+               });
        }
 }