X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftarget%2Fspawn.qc;h=1464da95511260b8ce4592e705b50bf9a62e7c2d;hb=59845bcb06720efc1f30ffbf550f7e04a4c51fcd;hp=eced856d7ecfcf331d18a49a225b28083a95c626;hpb=f6dd336135aa93ee4617df2389c3bfb28f0e1c58;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/target/spawn.qc b/qcsrc/common/triggers/target/spawn.qc index eced856d7..1464da955 100644 --- a/qcsrc/common/triggers/target/spawn.qc +++ b/qcsrc/common/triggers/target/spawn.qc @@ -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); + }); } }