void target_mal_laser_use (edict_t *self, edict_t *other, edict_t *activator) { self->activator = activator; if (self->spawnflags & 1) target_mal_laser_off (self); else target_mal_laser_on (self); }
void SP_target_mal_laser (edict_t *self) { self->movetype = MOVETYPE_NONE; self->solid = SOLID_NOT; self->s.renderfx |= RF_BEAM|RF_TRANSLUCENT; self->s.modelindex = 1; // must be non-zero // set the beam diameter if (self->spawnflags & 64) self->s.frame = 16; else self->s.frame = 4; // set the color if (self->spawnflags & 2) self->s.skinnum = 0xf2f2f0f0; else if (self->spawnflags & 4) self->s.skinnum = 0xd0d1d2d3; else if (self->spawnflags & 8) self->s.skinnum = 0xf3f3f1f1; else if (self->spawnflags & 16) self->s.skinnum = 0xdcdddedf; else if (self->spawnflags & 32) self->s.skinnum = 0xe0e1e2e3; G_SetMovedir (self->s.angles, self->movedir); if (!self->delay) self->delay = 0.1; if (!self->wait) self->wait = 0.1; if (!self->dmg) self->dmg = 5; VectorSet (self->mins, -8, -8, -8); VectorSet (self->maxs, 8, 8, 8); self->nextthink = level.time + self->delay; self->think = mal_laser_think; self->use = target_mal_laser_use; gi.linkentity (self); if (self->spawnflags & 1) target_mal_laser_on (self); else target_mal_laser_off (self); }
void target_mal_laser_use (edict_t *self, edict_t *other, edict_t *activator) { if (!self || !activator) { return; } self->activator = activator; if (self->spawnflags & 1) { target_mal_laser_off(self); } else { target_mal_laser_on(self); } }