From: TimePath Date: Sat, 15 Aug 2015 11:15:01 +0000 (+1000) Subject: Fix division by zero in sv_monsters.qc X-Git-Tag: xonotic-v0.8.1~3^2^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8b933fd412039ebb3786f0f5620d51dd1817da9;p=xonotic%2Fxonotic-data.pk3dir.git Fix division by zero in sv_monsters.qc --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 239f8fe9a..69e574d9e 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -592,7 +592,7 @@ void monster_CalculateVelocity(entity mon, vector to, vector from, float turnrat { float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis float initial_height = 0; //min(50, (targ_distance * tanh(20))); - float current_height = (initial_height * min(1, (current_distance / self.pass_distance))); + float current_height = (initial_height * min(1, self.pass_distance ? (current_distance / self.pass_distance) : 0)); //print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n"); vector targpos;