X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftarget%2Fspawn.qc;h=9c999ed4df4758612b9052a34aeb22101b85b905;hp=bc5271040c691516623d68240c241faad5fb6b32;hb=960a31b121488256a7eebcd6a22d0157b88643a7;hpb=fc15d72b041c9a748b605ba28735380fbe5b5b01 diff --git a/qcsrc/common/triggers/target/spawn.qc b/qcsrc/common/triggers/target/spawn.qc index bc5271040..9c999ed4d 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) @@ -11,8 +12,7 @@ // "classname" "target_spawn" // "message" "fieldname value fieldname value ..." // "spawnflags" -// 1 = call the spawn function -// 2 = trigger on map load +// ON_MAPLOAD = trigger on map load float target_spawn_initialized; .void(entity this) target_spawn_spawnfunc; @@ -54,7 +54,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 +149,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 +162,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 +188,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 +205,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; } } @@ -297,7 +297,7 @@ void target_spawn_use(entity this, entity actor, entity trigger) void target_spawn_spawnfirst(entity this) { entity act = this.target_spawn_activator; - if(this.spawnflags & 2) + if(this.spawnflags & ON_MAPLOAD) target_spawn_use(this, act, NULL); }