From: bones_was_here Date: Fri, 7 Oct 2022 10:11:22 +0000 (+1000) Subject: func_door: fix .angle values of 315 and 135 degrees being inverted X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8aa6d2d85ba1dfb3a633b6b635eb239decf703d2;p=xonotic%2Fxonotic-data.pk3dir.git func_door: fix .angle values of 315 and 135 degrees being inverted This bug was inherited from Quake and is fixed by updating to the same maths used in Quake 2 and 3. --- diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index aed02cf3d7..22c34f4ae3 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -757,7 +757,11 @@ spawnfunc(func_door) door_init_shared(this); this.pos1 = this.origin; - this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip); + vector absmovedir; + absmovedir.x = fabs(this.movedir.x); + absmovedir.y = fabs(this.movedir.y); + absmovedir.z = fabs(this.movedir.z); + this.pos2 = this.pos1 + this.movedir * (absmovedir * this.size - this.lip); if(autocvar_sv_doors_always_open) {