From b0e309667b409faea3589943b52c3327e95194b1 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 5 Apr 2021 19:47:49 +0200 Subject: [PATCH] Stick things slightly inside player hitboxes so they don't appear floating in the air that much --- qcsrc/common/util.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index d7de988d7..964e89520 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1921,12 +1921,22 @@ void SetMovetypeFollow(entity ent, entity e) ent.v_angle = ent.angles - e.angles; // relative angles ent.aiment_classname = strzone(e.classname); ent.aiment_deadflag = e.deadflag; + + if(IS_PLAYER(ent.aiment)) + { + entity pl = ent.aiment; + ent.view_ofs.x = bound(pl.mins.x + 4, ent.view_ofs.x, pl.maxs.x - 4); + ent.view_ofs.y = bound(pl.mins.y + 4, ent.view_ofs.y, pl.maxs.y - 4); + ent.view_ofs.z = bound(pl.mins.z + 4, ent.view_ofs.z, pl.maxs.z - 4); + } } void UnsetMovetypeFollow(entity ent) { set_movetype(ent, MOVETYPE_FLY); PROJECTILE_MAKETRIGGER(ent); + if (ent.aiment_classname) + strunzone(ent.classname); // FIXME: engine bug? // resetting aiment the engine will set orb's origin close to world's origin //ent.aiment = NULL; -- 2.39.2