}
float hmg_spread = bound(WEP_CVAR(hmg, spread_min), WEP_CVAR(hmg, spread_min) + (WEP_CVAR(hmg, spread_add) * actor.misc_bulletcounter), WEP_CVAR(hmg, spread_max));
- fireBullet(w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG.m_id, 0);
+ fireBullet(actor, w_shotorg, w_shotdir, hmg_spread, WEP_CVAR(hmg, solidpenetration), WEP_CVAR(hmg, damage), WEP_CVAR(hmg, force), WEP_HMG.m_id, 0);
actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
actor.tur_head = actor;
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
}
- fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
+ fireBullet (actor, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
W_MachineGun_MuzzleFlash();
setattachment(actor.muzzle_flash, actor.tur_head, "tag_fire");
}
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
}
sound (actor, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
- fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
+ fireBullet (actor, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
}
}
entity gun = this.vehicle;
return = true;
- setself(vehic);
-
// this isn't technically a vehicle (yet), let's not do frame functions on it (yet)
//vehicles_frame(gun, player);
vehic.solid = SOLID_BBOX;
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
this.vehicle_energy = (gun.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
-
- setself(this);
}
vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity player)
return;
}
- setself(vehic);
-
bumblebee_regen(vehic);
crosshair_trace(this);
setorigin(this, vehic.origin + v_up * 48 + v_forward * 160);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
-
- setself(this);
}
void bumblebee_land()
return;
}
- setself(vehic);
-
racer_align4point(vehic, PHYS_INPUT_TIMELENGTH);
PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
this.movement = vehic.velocity += df * PHYS_INPUT_TIMELENGTH;
#ifdef SVQC
+ setself(vehic);
+
Weapon wep1 = WEP_RACER;
if (!forbidWeaponUse(this))
if (PHYS_INPUT_BUTTON_ATCK(this))
wep1.wr_think(wep1, vehic, weaponentity, 1);
}
+ setself(this);
+
if(autocvar_g_vehicle_racer_rocket_locktarget)
{
vehicles_locktarget(vehic, (1 / autocvar_g_vehicle_racer_rocket_locking_time) * frametime,
setorigin(this, vehic.origin + '0 0 32');
this.velocity = vehic.velocity;
-
- setself(this);
}
void racer_think()
return;
}
- setself(vehic);
-
vehicles_frame(vehic, this);
float ftmp = 0;
UpdateAuxiliaryXhair(this, trace_endpos, '0 1 0', 0);
*/
+ // TODO: fix wr_checkammo and its use of self!
+ setself(vehic);
+
Weapon wep1 = WEP_RAPTOR;
if(!forbidWeaponUse(this))
if(PHYS_INPUT_BUTTON_ATCK(this))
}
}
+ setself(this);
+
vehic.bomb1.alpha = vehic.bomb2.alpha = (time - vehic.lip) / (vehic.delay - vehic.lip);
this.vehicle_reload2 = bound(0, vehic.bomb1.alpha * 100, 100);
this.vehicle_ammo2 = (this.vehicle_reload2 == 100) ? 100 : 0;
VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
-
- setself(this);
}
bool raptor_takeoff(entity this)
entity vehic = this.vehicle;
return = true;
- setself(this);
-
vehic.nextthink = time;
CSQCMODEL_AUTOUPDATE(vehic);
vehic.nextthink = 0; // will this work?
VEHICLE_UPDATE_PLAYER(this, vehic, shield, raptor);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false;
-
- setself(vehic);
}
void raptor_blowup()
return;
}
- setself(vehic);
-
vehicles_frame(vehic, this);
PHYS_INPUT_BUTTON_ZOOM(this) = false;
v_forward = normalize(v_forward);
v += v_forward * 50;
- WITH(entity, self, this, fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
- autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0));
+ fireBullet(this, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
+ autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
//trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false);
- WITH(entity, self, vehic, spiderbot_rocket_do());
+ spiderbot_rocket_do(vehic);
if(vehic.vehicle_flags & VHF_SHIELDREGEN)
vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true);
if(vehic.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(this, vehic, shield, spiderbot);
-
- setself(this);
}
void spiderbot_exit(float eject)
self.use();
}
-void spiderbot_guide_release()
-{SELFPARAM();
+void spiderbot_guide_release(entity this)
+{
entity rkt;
- rkt = findchainentity(realowner, self.owner);
+ rkt = findchainentity(realowner, this.owner);
if(!rkt)
return;
- crosshair_trace(self.owner);
+ crosshair_trace(this.owner);
while(rkt)
{
if(rkt.think == spiderbot_rocket_guided)
return sdir * vs + '0 0 1' * vz;
}
-void spiderbot_rocket_do()
-{SELFPARAM();
+void spiderbot_rocket_do(entity this)
+{;
vector v;
entity rocket = world;
- if (self.wait != -10)
+ if (this.wait != -10)
{
- if (PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.vehicle_weapon2mode == SBRM_GUIDE)
+ if (PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.vehicle_weapon2mode == SBRM_GUIDE)
{
- if (self.wait == 1)
- if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
+ if (this.wait == 1)
+ if (this.tur_head.frame == 9 || this.tur_head.frame == 1)
{
- if(self.gun2.cnt < time && self.tur_head.frame == 9)
- self.tur_head.frame = 1;
+ if(this.gun2.cnt < time && this.tur_head.frame == 9)
+ this.tur_head.frame = 1;
return;
}
- self.wait = 1;
+ this.wait = 1;
}
else
{
- if(self.wait)
- spiderbot_guide_release();
+ if(this.wait)
+ spiderbot_guide_release(this);
- self.wait = 0;
+ this.wait = 0;
}
}
- if(self.gun2.cnt > time)
+ if(this.gun2.cnt > time)
return;
- if (self.tur_head.frame >= 9)
+ if (this.tur_head.frame >= 9)
{
- self.tur_head.frame = 1;
- self.wait = 0;
+ this.tur_head.frame = 1;
+ this.wait = 0;
}
- if(self.wait != -10)
- if(!PHYS_INPUT_BUTTON_ATCK2(self.owner))
+ if(this.wait != -10)
+ if(!PHYS_INPUT_BUTTON_ATCK2(this.owner))
return;
- if(forbidWeaponUse(self.owner))
+ if(forbidWeaponUse(this.owner))
return;
- v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
+ v = gettaginfo(this.tur_head,gettagindex(this.tur_head,"tag_fire"));
- switch(self.vehicle_weapon2mode)
+ switch(this.vehicle_weapon2mode)
{
case SBRM_VOLLY:
- rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+ rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
- crosshair_trace(self.owner);
+ DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, this.owner);
+ crosshair_trace(this.owner);
float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
_dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
rocket.nextthink = time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
rocket.think = vehicles_projectile_explode;
- if(PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.tur_head.frame == 1)
- self.wait = -10;
+ if(PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.tur_head.frame == 1)
+ this.wait = -10;
break;
case SBRM_GUIDE:
- rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+ rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
- crosshair_trace(self.owner);
+ DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, this.owner);
+ crosshair_trace(this.owner);
rocket.pos1 = trace_endpos;
rocket.nextthink = time;
rocket.think = spiderbot_rocket_guided;
break;
case SBRM_ARTILLERY:
- rocket = vehicles_projectile(self, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
+ rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
- DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
+ DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, this.owner);
- crosshair_trace(self.owner);
+ crosshair_trace(this.owner);
rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius);
rocket.pos1_z = trace_endpos_z;
- traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+ traceline(v, v + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, this);
float h1 = 0.75 * vlen(v - trace_endpos);
//v = trace_endpos;
- traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, self);
+ traceline(v , rocket.pos1 + '0 0 1' * MAX_SHOT_DISTANCE, MOVE_WORLDONLY, this);
float h2 = 0.75 * vlen(rocket.pos1 - v);
rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
- self.tur_head.frame += 1;
- if (self.tur_head.frame == 9)
- self.attack_finished_single[0] = autocvar_g_vehicle_spiderbot_rocket_reload;
+ this.tur_head.frame += 1;
+ if (this.tur_head.frame == 9)
+ this.attack_finished_single[0] = autocvar_g_vehicle_spiderbot_rocket_reload;
else
- self.attack_finished_single[0] = ((self.vehicle_weapon2mode == SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
+ this.attack_finished_single[0] = ((this.vehicle_weapon2mode == SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
- self.gun2.cnt = time + self.attack_finished_single[0];
+ this.gun2.cnt = time + this.attack_finished_single[0];
}
#endif
#include <common/weapons/all.qh>
#ifdef SVQC
-void spiderbot_rocket_do();
+void spiderbot_rocket_do(entity this);
#endif
// 400 (x2) DPS
ATTACK_FINISHED(self, slot) = time + WEP_CVAR(machinegun, first_refire) * W_WeaponRateFactor();
if(self.misc_bulletcounter == 1)
- fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
+ fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, first_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, first_damage), WEP_CVAR(machinegun, first_force), deathtype, 0);
else
- fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
+ fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR(machinegun, sustained_spread), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), deathtype, 0);
Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
}
machinegun_spread = bound(WEP_CVAR(machinegun, spread_min), WEP_CVAR(machinegun, spread_min) + (WEP_CVAR(machinegun, spread_add) * actor.misc_bulletcounter), WEP_CVAR(machinegun, spread_max));
- fireBullet(w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
+ fireBullet(actor, w_shotorg, w_shotdir, machinegun_spread, WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
actor.punchangle_y = random() - 0.5;
}
- fireBullet(w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
+ fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR(machinegun, burst_speed), WEP_CVAR(machinegun, solidpenetration), WEP_CVAR(machinegun, sustained_damage), WEP_CVAR(machinegun, sustained_force), WEP_MACHINEGUN.m_id, 0);
Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
}
for(i = 0; i < pShots; ++i)
- fireBullet(w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
+ fireBullet(self, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
if(autocvar_g_casings >= 2)
SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
W_SetupShot(self, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets));
for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
- fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
+ fireBullet(self, w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0);
Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
fireBullet_last_hit = world;
}
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
-{SELFPARAM();
+void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
+{
vector end;
dir = normalize(dir + randomvec() * spread);
else
fireBullet_trace_callback_eff = EFFECT_BULLET;
- float lag = ANTILAG_LATENCY(self);
+ float lag = ANTILAG_LATENCY(this);
if(lag < 0.001)
lag = 0;
- if (!IS_REAL_CLIENT(self))
+ if (!IS_REAL_CLIENT(this))
lag = 0;
- if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
+ if(autocvar_g_antilag == 0 || this.cvar_cl_noantilag)
lag = 0; // only do hitscan, but no antilag
if(lag)
{
- FOREACH_CLIENT(IS_PLAYER(it) && it != self, antilag_takeback(it, CS(it), time - lag));
+ FOREACH_CLIENT(IS_PLAYER(it) && it != this, antilag_takeback(it, CS(it), time - lag));
FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
- if (it != self)
+ if (it != this)
antilag_takeback(it, it, time - lag);
});
}
// change shooter to SOLID_BBOX so the shot can hit corpses
- int oldsolid = self.dphitcontentsmask;
- if(self)
- self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+ int oldsolid = this.dphitcontentsmask;
+ if(this)
+ this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
- WarpZone_trace_forent = self;
+ WarpZone_trace_forent = this;
for (;;)
{
is_weapclip = true;
if(!hit || hit.solid == SOLID_BSP || hit.solid == SOLID_SLIDEBOX)
- Damage_DamageInfo(start, damage * solid_penetration_left, 0, 0, max(1, force) * dir * solid_penetration_left, dtype, hit.species, self);
+ Damage_DamageInfo(start, damage * solid_penetration_left, 0, 0, max(1, force) * dir * solid_penetration_left, dtype, hit.species, this);
if (hit && hit != WarpZone_trace_forent && hit != fireBullet_last_hit) // Avoid self-damage (except after going through a warp); avoid hitting the same entity twice (engine bug).
{
fireBullet_last_hit = hit;
yoda = 0;
- MUTATOR_CALLHOOK(FireBullet_Hit, self, hit, start, end, damage);
+ MUTATOR_CALLHOOK(FireBullet_Hit, this, hit, start, end, damage);
damage = frag_damage;
- float g = accuracy_isgooddamage(self, hit);
- Damage(hit, self, self, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
+ float g = accuracy_isgooddamage(this, hit);
+ Damage(hit, this, this, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
// calculate hits for ballistic weapons
if(g)
{
// do not exceed 100%
float added_damage = min(damage - total_damage, damage * solid_penetration_left);
total_damage += damage * solid_penetration_left;
- accuracy_add(self, PS(self).m_weapon.m_id, 0, added_damage);
+ accuracy_add(this, PS(this).m_weapon.m_id, 0, added_damage);
}
}
// Only show effect when going through a player (invisible otherwise)
if (hit && (hit.solid != SOLID_BSP))
if(vdist(trace_endpos - start, >, 4))
- trailparticles(self, fireBullet_trace_callback_eff, start, trace_endpos);
+ trailparticles(this, fireBullet_trace_callback_eff, start, trace_endpos);
start = trace_endpos;
if(hit.solid == SOLID_BSP)
- Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -solid_penetration_left, dtype, 0, self);
+ Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -solid_penetration_left, dtype, 0, this);
}
if(lag)
{
- FOREACH_CLIENT(IS_PLAYER(it) && it != self, antilag_restore(it, CS(it)));
+ FOREACH_CLIENT(IS_PLAYER(it) && it != this, antilag_restore(it, CS(it)));
FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
- if (it != self)
+ if (it != this)
antilag_restore(it, it);
});
}
// restore shooter solid type
- if(self)
- self.dphitcontentsmask = oldsolid;
+ if(this)
+ this.dphitcontentsmask = oldsolid;
}
entity fireBullet_trace_callback_eff;
entity fireBullet_last_hit;
void fireBullet_trace_callback(vector start, vector hit, vector end);
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
+void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);