diff --git a/csqc/pmove.qc b/csqc/pmove.qc index 6a6edfdf..7e4225fb 100644 --- a/csqc/pmove.qc +++ b/csqc/pmove.qc @@ -449,7 +449,8 @@ void PM_AddGrenadeExplosion(float itime, entity ent) { return; FO_GrenExp exp; - FO_GrenGetExp(ent.fpp.gren_type, exp); + if (!FO_GrenGetExp(ent.fpp.gren_type, exp)) + return; float dmg = exp.dmg; diff --git a/csqc/weapon_predict.qc b/csqc/weapon_predict.qc index 77468264..6fcd37bb 100644 --- a/csqc/weapon_predict.qc +++ b/csqc/weapon_predict.qc @@ -773,6 +773,7 @@ static void WP_InitSniper() { sight.drawmask = 0; float index = getmodelindex("progs/sight.spr"); setmodelindex(sight, index); + setsize(sight, [0,0,0], [0,0,0]); SniperState.sight = sight; } @@ -1384,11 +1385,10 @@ void FPP_Init(int fpp_type, entity proj) { render_type = FPP_GRENADE; setmodelindex(proj, FPP_Get(render_type)->modelindex); + setsize(proj, [0,0,0], [0,0,0]); proj.traileffectnum = FPP_FindTrail(proj); proj.movetype = desc->movetype; - - setsize(proj, [0,0,0], [0,0,0]); } DEFCVAR_FLOAT(r_rocketlight, 1); @@ -1516,6 +1516,7 @@ static void FPP_ApplyGrenadeProperties(entity proj) { FO_GrenInfo* gdesc = FO_GrenDesc(proj.fpp.gren_type); setmodelindex(proj, gdesc->modelindex); + setsize(proj, [0,0,0], [0,0,0]); proj.skin = gdesc->skin; proj.avelocity = gdesc->avelocity; } diff --git a/share/physics.qc b/share/physics.qc index f4e54746..8eca1583 100644 --- a/share/physics.qc +++ b/share/physics.qc @@ -32,8 +32,8 @@ static void Phys_Impact(entity e, float dt, float phys_flags) { if (other.solid == SOLID_NOT) return; - if (pointcontents(self.origin) == CONTENT_SKY) { - dremove_sent(self); + if (pointcontents(e.origin) == CONTENT_SKY) { + dremove_sent(e); return; } @@ -315,9 +315,9 @@ void Phys_Sim(entity e) { return; float ptime = time + phys_sim_dt; - if (ptime < self.phys_sim_last + SERVER_FRAME_DT) + if (ptime < e.phys_sim_last + SERVER_FRAME_DT) return; - self.phys_sim_last = ptime; + e.phys_sim_last = ptime; float held_phys_time = e.phys_time; vector held_org = e.origin; diff --git a/share/prediction.qc b/share/prediction.qc index 9aa81c13..495bc7b8 100644 --- a/share/prediction.qc +++ b/share/prediction.qc @@ -988,6 +988,9 @@ void FOProj_Finalize(entity mis, float use_ctime=0) { csqc_networking = (csqc_networking && fo_config.qc_physics); } + // After any model updates have occurred + setsize(mis, '0 0 0', '0 0 0'); + // We always need to init some of the state here (e.g. phys_time) as we // always use the physics code client-side. if (fo_config.qc_physics)