From: Mario Date: Wed, 19 Oct 2016 20:46:04 +0000 (+1000) Subject: Clean up monster direction checking code a bit more X-Git-Tag: xonotic-v0.8.2~496 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ae5c891a2dbe8e23f0d62b6121bfca904764de5;p=xonotic%2Fxonotic-data.pk3dir.git Clean up monster direction checking code a bit more --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 44ce0245b..fd921a032 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -1128,21 +1128,17 @@ void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff) return; } - bool reverse = false; - vector a, b; - makevectors(this.angles); - a = this.origin + '0 0 16'; - b = this.origin + '0 0 16' + v_forward * 32; + vector a = CENTER_OR_VIEWOFS(this); + vector b = CENTER_OR_VIEWOFS(this) + v_forward * 32; traceline(a, b, MOVE_NORMAL, this); + bool reverse = false; if(trace_fraction != 1.0) reverse = true; - if(trace_ent && IS_PLAYER(trace_ent) && !(trace_ent.items & ITEM_Strength.m_itemid)) reverse = false; - if(trace_ent && IS_MONSTER(trace_ent)) reverse = true;