From 5ab11184e635c257a13355f1319dbf208bce4d20 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 5 Nov 2022 18:40:53 +0100 Subject: [PATCH] Fix #2744 "Blocking of bmodel movers is broken" --- qcsrc/common/mapobjects/func/door.qc | 4 ++++ qcsrc/common/mapobjects/subs.qc | 6 ++++++ qcsrc/common/mapobjects/subs.qh | 2 ++ 3 files changed, 12 insertions(+) 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); -- 2.39.2