From: Mario Date: Wed, 31 Jul 2024 01:49:32 +0000 (+1000) Subject: Prevent division by zero when warpzones teleport a stationary player X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2ef0221b405abdf1b954135e2ff7b4333004f70c;p=xonotic%2Fxonotic-data.pk3dir.git Prevent division by zero when warpzones teleport a stationary player --- diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index f216aa9c6..3a98911e4 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -145,7 +145,7 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1) #ifdef SVQC // prevent further teleports back - float dt = (o1 - o10) * v1 * (1 / (v1 * v1)); + float dt = (v1 != '0 0 0') ? (o1 - o10) * v1 * (1 / (v1 * v1)) : 0; if(dt < PHYS_INPUT_FRAMETIME) player.warpzone_teleport_finishtime += PHYS_INPUT_FRAMETIME - dt; #endif