void G_SpawnStunSmokeField (const vec3_t vec, const char *particle, int rounds, int damage, vec_t radius) { vec_t x, y; G_SpawnStunSmoke(vec, particle, rounds, damage); for (x = vec[0] - radius; x <= vec[0] + radius; x += UNIT_SIZE) { for (y = vec[1] - radius; y <= vec[1] + radius; y += UNIT_SIZE) { vec3_t end; trace_t tr; VectorSet(end, x, y, vec[2]); if (VectorDist(end, vec) > radius) continue; tr = G_Trace(vec, end, NULL, MASK_SMOKE_AND_FIRE); /* trace didn't reach the target - something was hit before */ if (tr.fraction < 1.0 || (tr.contentFlags & CONTENTS_WATER)) { continue; } G_SpawnStunSmoke(end, particle, rounds, damage); } } }
static void G_SpawnFieldPart (const entity_type_t fieldtype, const vec3_t vec, const char* particle, int rounds, int damage) { switch (fieldtype) { case ET_SMOKE: G_SpawnSmoke(vec, particle, rounds); break; case ET_FIRE: G_SpawnFire(vec, particle, rounds, damage); break; case ET_SMOKESTUN: G_SpawnStunSmoke(vec, particle, rounds, damage); break; default: break; } }