From 8aa6d2d85ba1dfb3a633b6b635eb239decf703d2 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Fri, 7 Oct 2022 20:11:22 +1000 Subject: [PATCH] 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. --- qcsrc/common/mapobjects/func/door.qc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.39.2