From: terencehill Date: Mon, 5 Apr 2021 17:47:49 +0000 (+0200) Subject: Stick things slightly inside player hitboxes so they don't appear floating in the... X-Git-Tag: xonotic-v0.8.5~465 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=b0e309667b409faea3589943b52c3327e95194b1;hp=0889fb8c0698cba8c004582c5df149356511f7ad;p=xonotic%2Fxonotic-data.pk3dir.git Stick things slightly inside player hitboxes so they don't appear floating in the air that much --- 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;