]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
func_door: fix .angle values of 315 and 135 degrees being inverted
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 7 Oct 2022 10:11:22 +0000 (20:11 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 15 Sep 2023 07:11:41 +0000 (17:11 +1000)
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

index aed02cf3d7c4de966c9d11309d4cdcb27f9cf9d8..22c34f4ae36f85f010b01430d466d05a07249e81 100644 (file)
@@ -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)
        {