From: terencehill Date: Sat, 5 Nov 2022 17:40:53 +0000 (+0100) Subject: Fix #2744 "Blocking of bmodel movers is broken" X-Git-Tag: xonotic-v0.8.6~294^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ab11184e635c257a13355f1319dbf208bce4d20;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2744 "Blocking of bmodel movers is broken" --- diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 6b69077a0..2dcd2333d 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -27,6 +27,7 @@ void door_go_up(entity this, entity actor, entity trigger); void door_blocked(entity this, entity blocker) { + bool reverse = false; if((this.spawnflags & DOOR_CRUSH) #ifdef SVQC && (blocker.takedamage != DAMAGE_NO) @@ -69,6 +70,7 @@ void door_blocked(entity this, entity blocker) else door_rotating_go_down(this); } + reverse = true; } } #ifdef SVQC @@ -80,6 +82,8 @@ void door_blocked(entity this, entity blocker) } #endif } + if (!reverse) + SUB_CalcMovePause(this); } void door_hit_top(entity this) diff --git a/qcsrc/common/mapobjects/subs.qc b/qcsrc/common/mapobjects/subs.qc index 39573a482..9c59fbf5f 100644 --- a/qcsrc/common/mapobjects/subs.qc +++ b/qcsrc/common/mapobjects/subs.qc @@ -102,6 +102,12 @@ void SUB_CalcMoveDone(entity this) this.think1 (this); } +void SUB_CalcMovePause(entity this) +{ + this.move_controller.animstate_starttime += frametime; + this.move_controller.animstate_endtime += frametime; +} + .float platmovetype_turn; void SUB_CalcMove_controller_think (entity this) { diff --git a/qcsrc/common/mapobjects/subs.qh b/qcsrc/common/mapobjects/subs.qh index c1d4d06e5..d6071d415 100644 --- a/qcsrc/common/mapobjects/subs.qh +++ b/qcsrc/common/mapobjects/subs.qh @@ -99,6 +99,8 @@ this.origin traveling at speed */ void SUB_CalcMoveDone(entity this); +void SUB_CalcMovePause(entity this); + .float platmovetype_turn; void SUB_CalcMove_controller_think (entity this);