if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) {
if (isPlayer) {
turret_initparams(actor);
- W_SetupShot_Dir(actor, v_forward, false, 0, SND_TeslaCoilTurretAttack_FIRE, CH_WEAPON_B, 0);
+ W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_TeslaCoilTurretAttack_FIRE, CH_WEAPON_B, 0);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
actor.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK;
entity t = toast(actor, e,r,d);
- remove(e);
+ delete(e);
if (t == NULL) return;
d *= 0.75;
r *= 0.85;
t = toast(actor, t, r, d);
- if (t == world) break;
+ if (t == NULL) break;
}
- e = findchainfloat(railgunhit, 1);
- while (e) {
- e.railgunhit = 0;
- e = e.chain;
- }
-
+ FOREACH_ENTITY_FLOAT(railgunhit, 1,
+ {
+ it.railgunhit = 0;
+ });
}
}
entity toast(entity actor, entity from, float range, float damage)
{
entity e;
- entity etarget = world;
+ entity etarget = NULL;
float d,dd;
float r;