]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure monster turns around if it touches another monster
authorMario <mario@smbclan.net>
Wed, 19 Oct 2016 20:35:06 +0000 (06:35 +1000)
committerMario <mario@smbclan.net>
Wed, 19 Oct 2016 20:35:06 +0000 (06:35 +1000)
qcsrc/common/monsters/sv_monsters.qc

index 3de0ad8d49308bf5e0c53196276e1a1b8c64be83..0b43ab7870b5448432b64d07170db328ebf46521 100644 (file)
@@ -1128,7 +1128,7 @@ void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff)
                return;
        }
 
-       float reverse = false;
+       bool reverse = false;
        vector a, b;
 
        makevectors(this.angles);
@@ -1142,8 +1142,11 @@ void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff)
                reverse = true;
 
                if(trace_ent)
-               if(IS_PLAYER(trace_ent) && !(trace_ent.items & IT_STRENGTH))
+               if(IS_PLAYER(trace_ent) && !(trace_ent.items & ITEM_Strength.m_itemid))
                        reverse = false;
+
+               if(trace_ent && IS_MONSTER(trace_ent))
+                       reverse = true;
        }
 
        // TODO: fix this... tracing is broken if the floor is thin