Regarding ice.qc and darknes.qc the only functional change is the addition of `timer.nade_lifetime = this.nade_lifetime;`,
the remaining changes are cleanups to make the code more intuitive and readable
setorigin(fountain, fountain.origin);
setthink(fountain, nade_darkness_think);
fountain.nextthink = time;
- fountain.ltime = time + autocvar_g_nades_darkness_time;
- fountain.pushltime = fountain.wait = fountain.ltime;
+ fountain.pushltime = fountain.wait = fountain.ltime = time + autocvar_g_nades_darkness_time;
fountain.team = this.team;
set_movetype(fountain, MOVETYPE_TOSS);
fountain.projectiledeathtype = DEATH_NADE.m_id;
timer.glowmod = this.glowmod;
setthink(timer, nade_timer_think);
timer.nextthink = time;
- timer.wait = fountain.ltime;
+ timer.wait = fountain.wait;
+ timer.nade_lifetime = this.nade_lifetime;
timer.owner = fountain;
timer.skin = 10;
}
setorigin(fountain, fountain.origin);
setthink(fountain, nade_ice_think);
fountain.nextthink = time;
- fountain.ltime = time + autocvar_g_nades_ice_freeze_time;
- fountain.pushltime = fountain.wait = fountain.ltime;
+ fountain.pushltime = fountain.wait = fountain.ltime = time + autocvar_g_nades_ice_freeze_time;
fountain.team = this.team;
set_movetype(fountain, MOVETYPE_TOSS);
fountain.projectiledeathtype = DEATH_NADE_ICE.m_id;
timer.glowmod = this.glowmod;
setthink(timer, nade_timer_think);
timer.nextthink = time;
- timer.wait = fountain.ltime;
+ timer.wait = fountain.wait;
+ timer.nade_lifetime = this.nade_lifetime;
timer.owner = fountain;
timer.skin = 10;
}
#include <server/command/common.qh>
.float nade_time_primed;
-.float nade_lifetime;
.entity nade_spawnloc;
void nade_timer_think(entity this)
{
- this.skin = 8 - (this.owner.wait - time) / (this.owner.nade_lifetime / 10);
+ this.skin = 8 - (this.wait - time) / (this.nade_lifetime / 10);
this.nextthink = time;
if(!this.owner || wasfreed(this.owner))
delete(this);
setthink(timer, nade_timer_think);
timer.nextthink = time;
timer.wait = _nade.wait;
+ timer.nade_lifetime = _nade.nade_lifetime;
timer.owner = _nade;
timer.skin = 10;
.entity nade;
.entity fake_nade;
+.float nade_lifetime;
.float nade_refire;
.float nade_special_time;
.string pokenade_type;