]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reset door locking when the match is reset
authorbones_was_here <bones_was_here@xonotic.au>
Sat, 16 Mar 2024 06:58:42 +0000 (16:58 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Wed, 17 Apr 2024 14:49:37 +0000 (00:49 +1000)
qcsrc/common/mapobjects/func/door.qc

index 25e9ba844e75e89a5752569f2e81d2f061bd6b4f..30909e4c453cf03172dae866051677272b6d1e24 100644 (file)
@@ -614,6 +614,15 @@ void door_link()
 {
        //Net_LinkEntity(this, false, 0, door_send);
 }
+
+void door_init_keys(entity this)
+{
+       // Quake 1 and QL keys compatibility
+       if (this.spawnflags & SPAWNFLAGS_GOLD_KEY)
+               this.itemkeys |= BIT(0);
+       if (this.spawnflags & SPAWNFLAGS_SILVER_KEY)
+               this.itemkeys |= BIT(1);
+}
 #endif
 
 void door_init_startopen(entity this)
@@ -637,6 +646,7 @@ void door_reset(entity this)
 
 #ifdef SVQC
        this.SendFlags |= SF_TRIGGER_RESET;
+       door_init_keys(this);
 #endif
 }
 
@@ -750,11 +760,7 @@ void door_init_shared(entity this)
 // spawnflags require key (for now only func_door)
 spawnfunc(func_door)
 {
-       // Quake 1 and QL keys compatibility
-       if (this.spawnflags & SPAWNFLAGS_GOLD_KEY)
-               this.itemkeys |= BIT(0);
-       if (this.spawnflags & SPAWNFLAGS_SILVER_KEY)
-               this.itemkeys |= BIT(1);
+       door_init_keys(this);
 
        SetMovedir(this);