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://de.git.xonotic.org/?a=commitdiff_plain;h=61028ef5dd65bb17faa8869d31be331384a3b488;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 aed02cf3d..22c34f4ae 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) {