]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2744 "Blocking of bmodel movers is broken"
authorterencehill <piuntn@gmail.com>
Sat, 5 Nov 2022 17:40:53 +0000 (18:40 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 5 Nov 2022 17:40:53 +0000 (18:40 +0100)
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/subs.qc
qcsrc/common/mapobjects/subs.qh

index 6b69077a09abe2d7e49925a1fc9bb4df72025be3..2dcd2333d214f3137a0de938a1fe9582524b9906 100644 (file)
@@ -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)
index 39573a4823676a0bab8e48e9a57844dc8c5f767f..9c59fbf5f92ad0bb11bb74d00a5c1bd5081e1345 100644 (file)
@@ -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)
 {
index c1d4d06e56f276cc1bff37f9d93e7e250f01788b..d6071d41580908945babb4406bc67260b0a47966 100644 (file)
@@ -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);