void MoveToLast(entity e)
{
AuditLists();
- other = e.sort_next;
- while(other)
+ entity ent = e.sort_next;
+ while(ent)
{
- SORT_SWAP(other, e);
- other = e.sort_next;
+ SORT_SWAP(ent, e);
+ ent = e.sort_next;
}
AuditLists();
}
void HUD_UpdatePlayerPos(entity player)
{
- for(other = player.sort_next; other && HUD_ComparePlayerScores(player, other); other = player.sort_next)
+ entity ent;
+ for(ent = player.sort_next; ent && HUD_ComparePlayerScores(player, ent); ent = player.sort_next)
{
- SORT_SWAP(player, other);
+ SORT_SWAP(player, ent);
}
- for(other = player.sort_prev; other != players && HUD_ComparePlayerScores(other, player); other = player.sort_prev)
+ for(ent = player.sort_prev; ent != players && HUD_ComparePlayerScores(ent, player); ent = player.sort_prev)
{
- SORT_SWAP(other, player);
+ SORT_SWAP(ent, player);
}
}
void HUD_UpdateTeamPos(entity Team)
{
- for(other = Team.sort_next; other && HUD_CompareTeamScores(Team, other); other = Team.sort_next)
+ entity ent;
+ for(ent = Team.sort_next; ent && HUD_CompareTeamScores(Team, ent); ent = Team.sort_next)
{
- SORT_SWAP(Team, other);
+ SORT_SWAP(Team, ent);
}
- for(other = Team.sort_prev; other != teams && HUD_CompareTeamScores(other, Team); other = Team.sort_prev)
+ for(ent = Team.sort_prev; ent != teams && HUD_CompareTeamScores(ent, Team); ent = Team.sort_prev)
{
- SORT_SWAP(other, Team);
+ SORT_SWAP(ent, Team);
}
}
return false;
}
-void M_Mage_Attack_Spike_Explode(entity this)
+void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
this.realowner.mage_spike = NULL;
Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1);
- RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, other);
+ RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, directhitentity);
remove (this);
}
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, M_Mage_Attack_Spike_Explode(this));
+ M_Mage_Attack_Spike_Explode(this, toucher);
}
.float wait;
{
if (time > this.ltime || (this.enemy && this.enemy.health <= 0) || this.owner.health <= 0) {
this.projectiledeathtype |= HITTYPE_SPLASH;
- M_Mage_Attack_Spike_Explode(this);
+ M_Mage_Attack_Spike_Explode(this, NULL);
}
float spd = vlen(this.velocity);
#include <common/effects/qc/all.qh>
-void M_Shambler_Attack_Lightning_Explode(entity this)
+void M_Shambler_Attack_Lightning_Explode(entity this, entity directhitentity)
{
sound(this, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_ELECTRO_IMPACT, this.origin, '0 0 0', 1);
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius), NULL, NULL, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius),
+ NULL, NULL, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, directhitentity);
FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_shambler_attack_lightning_radius_zap, it != this.realowner && it.takedamage,
{
void M_Shambler_Attack_Lightning_Explode_use(entity this, entity actor, entity trigger)
{
- M_Shambler_Attack_Lightning_Explode(this);
+ M_Shambler_Attack_Lightning_Explode(this, trigger);
}
void M_Shambler_Attack_Lightning_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
}
void M_Shambler_Attack_Lightning_Think(entity this)
this.nextthink = time;
if (time > this.cnt)
{
- other = NULL;
- M_Shambler_Attack_Lightning_Explode(this);
+ M_Shambler_Attack_Lightning_Explode(this, NULL);
return;
}
}
#ifdef SVQC
spawnfunc(weapon_rpc) { weapon_defaultspawnfunc(this, WEP_RPC); }
-void W_RocketPropelledChainsaw_Explode(entity this)
+void W_RocketPropelledChainsaw_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), NULL, NULL, WEP_CVAR(rpc, force), this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), NULL, NULL, WEP_CVAR(rpc, force), this.projectiledeathtype, directhitentity);
remove (this);
}
+void W_RocketPropelledChainsaw_Explode_think(entity this)
+{
+ W_RocketPropelledChainsaw_Explode(this, NULL);
+}
+
void W_RocketPropelledChainsaw_Touch (entity this, entity toucher)
{
if(WarpZone_Projectile_Touch(this, toucher))
if(wasfreed(this))
return;
- WITH(entity, other, toucher, W_RocketPropelledChainsaw_Explode(this));
+ W_RocketPropelledChainsaw_Explode(this, toucher);
}
void W_RocketPropelledChainsaw_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
this.health = this.health - damage;
if (this.health <= 0)
- W_PrepareExplosionByDamage(this, attacker, W_RocketPropelledChainsaw_Explode);
+ W_PrepareExplosionByDamage(this, attacker, W_RocketPropelledChainsaw_Explode_think);
}
void W_RocketPropelledChainsaw_Think(entity this)
{
this.move_nextthink = 0;
this.move_time = time;
- other = NULL;
this.move_think(this);
}
}
//dprint("Heat: ",ftos(player.arc_heat_percent*100),"%\n");
}
-void W_Arc_Bolt_Explode(entity this)
+void W_Arc_Bolt_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Arc_Bolt_Explode_use(entity this, entity actor, entity trigger)
{
- W_Arc_Bolt_Explode(this);
+ W_Arc_Bolt_Explode(this, trigger);
}
void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
void W_Arc_Bolt_Touch(entity this, entity toucher)
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
}
void W_Arc_Attack_Bolt(Weapon thiswep, entity actor)
}
// force projectile to explode
-void W_Crylink_LinkExplode(entity e, entity e2)
+void W_Crylink_LinkExplode(entity e, entity e2, entity directhitentity)
{
float a;
float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
- RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other);
+ RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius),
+ NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, directhitentity);
W_Crylink_LinkExplode(e.queuenext, e2);
NULL,
WEP_CVAR_BOTH(crylink, isprimary, joinexplode_force) * n,
e.projectiledeathtype,
- other
+ NULL
);
Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, this.origin, '0 0 0', n);
}
{
if(this == this.realowner.crylink_lastgroup)
this.realowner.crylink_lastgroup = NULL;
- WITH(entity, other, toucher, W_Crylink_LinkExplode(this.queuenext, this));
+ W_Crylink_LinkExplode(this.queuenext, this, toucher);
this.classname = "spike_oktoremove";
remove(this);
return;
}
}
-void W_Devastator_Explode(entity this)
+void W_Devastator_Explode(entity this, entity directhitentity)
{
W_Devastator_Unregister(this);
- if(other.takedamage == DAMAGE_AIM)
- if(IS_PLAYER(other))
- if(DIFF_TEAM(this.realowner, other))
- if(!IS_DEAD(other))
- if(IsFlying(other))
+ if(directhitentity.takedamage == DAMAGE_AIM)
+ if(IS_PLAYER(directhitentity))
+ if(DIFF_TEAM(this.realowner, directhitentity))
+ if(!IS_DEAD(directhitentity))
+ if(IsFlying(directhitentity))
Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
this.event_damage = func_null;
NULL,
WEP_CVAR(devastator, force),
this.projectiledeathtype,
- other
+ directhitentity
);
Weapon thiswep = WEP_DEVASTATOR;
remove(this);
}
+void W_Devastator_Explode_think(entity this)
+{
+ W_Devastator_Explode(this, NULL);
+}
+
void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
{
W_Devastator_Unregister(this);
this.nextthink = time;
if(time > this.cnt)
{
- other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
- W_Devastator_Explode(this);
+ W_Devastator_Explode(this, NULL);
return;
}
return;
}
W_Devastator_Unregister(this);
- WITH(entity, other, toucher, W_Devastator_Explode(this));
+ W_Devastator_Explode(this, toucher);
}
void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
this.angles = vectoangles(this.velocity);
if(this.health <= 0)
- W_PrepareExplosionByDamage(this, attacker, W_Devastator_Explode);
+ W_PrepareExplosionByDamage(this, attacker, W_Devastator_Explode_think);
}
void W_Devastator_Attack(Weapon thiswep, entity actor)
remove(this);
}
-void W_Electro_Explode(entity this)
+void W_Electro_Explode(entity this, entity directhitentity)
{
- if(other.takedamage == DAMAGE_AIM)
- if(IS_PLAYER(other))
- if(DIFF_TEAM(this.realowner, other))
- if(!IS_DEAD(other))
- if(IsFlying(other))
+ if(directhitentity.takedamage == DAMAGE_AIM)
+ if(IS_PLAYER(directhitentity))
+ if(DIFF_TEAM(this.realowner, directhitentity))
+ if(!IS_DEAD(directhitentity))
+ if(IsFlying(directhitentity))
Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
this.event_damage = func_null;
NULL,
WEP_CVAR_SEC(electro, force),
this.projectiledeathtype,
- other
+ directhitentity
);
}
else
NULL,
WEP_CVAR_PRI(electro, force),
this.projectiledeathtype,
- other
+ directhitentity
);
}
void W_Electro_Explode_use(entity this, entity actor, entity trigger)
{
- W_Electro_Explode(this);
+ W_Electro_Explode(this, trigger);
}
void W_Electro_TouchExplode(entity this, entity toucher)
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, W_Electro_Explode(this));
+ W_Electro_Explode(this, toucher);
}
void W_Electro_Bolt_Think(entity this)
{
PROJECTILE_TOUCH(this, toucher);
if(toucher.takedamage == DAMAGE_AIM)
- { if(WEP_CVAR_SEC(electro, touchexplode)) { WITH(entity, other, toucher, W_Electro_Explode(this)); } }
+ { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(this, toucher); } }
else
{
//UpdateCSQCProjectile(this);
#ifdef SVQC
spawnfunc(weapon_fireball) { weapon_defaultspawnfunc(this, WEP_FIREBALL); }
-void W_Fireball_Explode(entity this)
+void W_Fireball_Explode(entity this, entity directhitentity)
{
entity e;
float dist;
// 1. dist damage
d = (this.realowner.health + this.realowner.armorvalue);
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), NULL, NULL, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), NULL, NULL, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, directhitentity);
if(this.realowner.health + this.realowner.armorvalue >= d)
if(!this.cnt)
{
remove(this);
}
+void W_Fireball_Explode_think(entity this)
+{
+ W_Fireball_Explode(this, NULL);
+}
+
void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
{
- W_Fireball_Explode(this);
+ W_Fireball_Explode(this, trigger);
}
void W_Fireball_TouchExplode(entity this, entity toucher)
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, W_Fireball_Explode(this));
+ W_Fireball_Explode(this, toucher);
}
void W_Fireball_LaserPlay(entity this, float dt, float dist, float damage, float edgedamage, float burntime)
{
this.cnt = 1;
this.projectiledeathtype |= HITTYPE_SPLASH;
- W_Fireball_Explode(this);
+ W_Fireball_Explode(this, NULL);
return;
}
if(this.health <= 0)
{
this.cnt = 1;
- W_PrepareExplosionByDamage(this, attacker, W_Fireball_Explode);
+ W_PrepareExplosionByDamage(this, attacker, W_Fireball_Explode_think);
}
}
// NO bounce protection, as bounces are limited!
-void W_Hagar_Explode(entity this)
+void W_Hagar_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
{
- W_Hagar_Explode(this);
+ W_Hagar_Explode(this, trigger);
}
-void W_Hagar_Explode2(entity this)
+void W_Hagar_Explode2(entity this, entity directhitentity)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
{
- W_Hagar_Explode2(this);
+ W_Hagar_Explode2(this, trigger);
}
void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
void W_Hagar_Touch(entity this, entity toucher)
{
PROJECTILE_TOUCH(this, toucher);
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
}
void W_Hagar_Touch2(entity this, entity toucher)
PROJECTILE_TOUCH(this, toucher);
if(this.cnt > 0 || toucher.takedamage == DAMAGE_AIM) {
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
} else {
this.cnt++;
Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
SetMovetypeFollow(newmine, to);
}
-void W_MineLayer_Explode(entity this)
+void W_MineLayer_Explode(entity this, entity directhitentity)
{
- if(other.takedamage == DAMAGE_AIM)
- if(IS_PLAYER(other))
- if(DIFF_TEAM(this.realowner, other))
- if(!IS_DEAD(other))
- if(IsFlying(other))
+ if(directhitentity.takedamage == DAMAGE_AIM)
+ if(IS_PLAYER(directhitentity))
+ if(DIFF_TEAM(this.realowner, directhitentity))
+ if(!IS_DEAD(directhitentity))
+ if(IsFlying(directhitentity))
Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, directhitentity);
if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
{
remove(this);
}
+void W_MineLayer_Explode_think(entity this)
+{
+ W_MineLayer_Explode(this, NULL);
+}
+
void W_MineLayer_DoRemoteExplode(entity this)
{
this.event_damage = func_null;
}
this.mine_time = 0;
- W_MineLayer_Explode(this);
+ W_MineLayer_Explode(this, NULL);
}
int W_MineLayer_Count(entity e)
// TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
{
- other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
- W_MineLayer_Explode(this);
+ W_MineLayer_Explode(this, NULL);
return;
}
this.angles = vectoangles(this.velocity);
if(this.health <= 0)
- W_PrepareExplosionByDamage(this, attacker, W_MineLayer_Explode);
+ W_PrepareExplosionByDamage(this, attacker, W_MineLayer_Explode_think);
}
void W_MineLayer_Attack(Weapon thiswep, entity actor)
spawnfunc(weapon_mortar) { weapon_defaultspawnfunc(this, WEP_MORTAR); }
spawnfunc(weapon_grenadelauncher) { spawnfunc_weapon_mortar(this); }
-void W_Mortar_Grenade_Explode(entity this)
+void W_Mortar_Grenade_Explode(entity this, entity directhitentity)
{
- if(other.takedamage == DAMAGE_AIM)
- if(IS_PLAYER(other))
- if(DIFF_TEAM(this.realowner, other))
- if(!IS_DEAD(other))
- if(IsFlying(other))
+ if(directhitentity.takedamage == DAMAGE_AIM)
+ if(IS_PLAYER(directhitentity))
+ if(DIFF_TEAM(this.realowner, directhitentity))
+ if(!IS_DEAD(directhitentity))
+ if(IsFlying(directhitentity))
Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
this.event_damage = func_null;
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Mortar_Grenade_Explode_use(entity this, entity actor, entity trigger)
{
- W_Mortar_Grenade_Explode(this);
+ W_Mortar_Grenade_Explode(this, trigger);
}
-void W_Mortar_Grenade_Explode2(entity this)
+void W_Mortar_Grenade_Explode2(entity this, entity directhitentity)
{
- if(other.takedamage == DAMAGE_AIM)
- if(IS_PLAYER(other))
- if(DIFF_TEAM(this.realowner, other))
- if(!IS_DEAD(other))
- if(IsFlying(other))
+ if(directhitentity.takedamage == DAMAGE_AIM)
+ if(IS_PLAYER(directhitentity))
+ if(DIFF_TEAM(this.realowner, directhitentity))
+ if(!IS_DEAD(directhitentity))
+ if(IsFlying(directhitentity))
Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
this.event_damage = func_null;
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Mortar_Grenade_Explode2_use(entity this, entity actor, entity trigger)
{
- W_Mortar_Grenade_Explode2(this);
+ W_Mortar_Grenade_Explode2(this, trigger);
}
void W_Mortar_Grenade_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
this.nextthink = time;
if(time > this.cnt)
{
- other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
- W_Mortar_Grenade_Explode(this);
+ W_Mortar_Grenade_Explode(this, NULL);
return;
}
if(this.gl_detonate_later && this.gl_bouncecnt >= WEP_CVAR_PRI(mortar, remote_minbouncecnt))
- W_Mortar_Grenade_Explode(this);
+ W_Mortar_Grenade_Explode(this, NULL);
}
void W_Mortar_Grenade_Touch1(entity this, entity toucher)
PROJECTILE_TOUCH(this, toucher);
if(toucher.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
}
else if(WEP_CVAR_PRI(mortar, type) == 1) // bounce
{
PROJECTILE_TOUCH(this, toucher);
if(toucher.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile
{
- WITH(entity, other, toucher, this.use(this, NULL, NULL));
+ this.use(this, NULL, toucher);
}
else if(WEP_CVAR_SEC(mortar, type) == 1) // bounce
{
// ============================
// Begin: Missile functions, these are general functions to be manipulated by other code
// ============================
-void W_Seeker_Missile_Explode(entity this)
+void W_Seeker_Missile_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, directhitentity);
remove(this);
}
+void W_Seeker_Missile_Explode_think(entity this)
+{
+ W_Seeker_Missile_Explode(this, NULL);
+}
+
void W_Seeker_Missile_Touch(entity this, entity toucher)
{
PROJECTILE_TOUCH(this, toucher);
- // TODO
- WITH(entity, other, toucher, W_Seeker_Missile_Explode(this));
+ W_Seeker_Missile_Explode(this, toucher);
}
void W_Seeker_Missile_Think(entity this)
if(time > this.cnt)
{
this.projectiledeathtype |= HITTYPE_SPLASH;
- W_Seeker_Missile_Explode(this);
+ W_Seeker_Missile_Explode(this, NULL);
}
spd = vlen(this.velocity);
{
if(this.autoswitch <= time)
{
- W_Seeker_Missile_Explode(this);
+ W_Seeker_Missile_Explode(this, NULL);
this.autoswitch = 0;
}
}
this.health = this.health - damage;
if(this.health <= 0)
- W_PrepareExplosionByDamage(this, attacker, W_Seeker_Missile_Explode);
+ W_PrepareExplosionByDamage(this, attacker, W_Seeker_Missile_Explode_think);
}
/*
// ============================
// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
// ============================
-void W_Seeker_Flac_Explode(entity this)
+void W_Seeker_Flac_Explode(entity this, entity directhitentity)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, directhitentity);
remove(this);
}
void W_Seeker_Flac_Touch(entity this, entity toucher)
{
- WITH(entity, other, toucher, W_Seeker_Flac_Explode(this));
+ W_Seeker_Flac_Explode(this, toucher);
}
void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
{
- WITH(entity, other, trigger, W_Seeker_Flac_Explode(this));
+ W_Seeker_Flac_Explode(this, trigger);
}
void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
{
//if(other==this.realowner)
// return;
- Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, other.species, this);
+ Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, 0, this);
remove(this);
}
bool SpectateNext(entity this)
{
- other = find(this.enemy, classname, STR_PLAYER);
+ entity ent = find(this.enemy, classname, STR_PLAYER);
- if (MUTATOR_CALLHOOK(SpectateNext, this, other))
- other = M_ARGV(1, entity);
- else if (!other)
- other = find(other, classname, STR_PLAYER);
+ if (MUTATOR_CALLHOOK(SpectateNext, this, ent))
+ ent = M_ARGV(1, entity);
+ else if (!ent)
+ ent = find(ent, classname, STR_PLAYER);
- if(other) { SetSpectatee(this, other); }
+ if(ent) { SetSpectatee(this, ent); }
return SpectateSet(this);
}
bool SpectatePrev(entity this)
{
// NOTE: chain order is from the highest to the lower entnum (unlike find)
- other = findchain(classname, STR_PLAYER);
- if (!other) // no player
+ entity ent = findchain(classname, STR_PLAYER);
+ if (!ent) // no player
return false;
- entity first = other;
+ entity first = ent;
// skip players until current spectated player
if(this.enemy)
- while(other && other != this.enemy)
- other = other.chain;
+ while(ent && ent != this.enemy)
+ ent = ent.chain;
- switch (MUTATOR_CALLHOOK(SpectatePrev, this, other, first))
+ switch (MUTATOR_CALLHOOK(SpectatePrev, this, ent, first))
{
case MUT_SPECPREV_FOUND:
- other = M_ARGV(1, entity);
+ ent = M_ARGV(1, entity);
break;
case MUT_SPECPREV_RETURN:
- other = M_ARGV(1, entity);
+ ent = M_ARGV(1, entity);
return true;
case MUT_SPECPREV_CONTINUE:
default:
{
- if(other.chain)
- other = other.chain;
+ if(ent.chain)
+ ent = ent.chain;
else
- other = first;
+ ent = first;
break;
}
}
- SetSpectatee(this, other);
+ SetSpectatee(this, ent);
return SpectateSet(this);
}