From: bones_was_here Date: Sat, 16 Mar 2024 06:58:42 +0000 (+1000) Subject: Reset door locking when the match is reset X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3e095f0bd49bb0b8a6722133537c0240163e569a;p=xonotic%2Fxonotic-data.pk3dir.git Reset door locking when the match is reset --- diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 25e9ba844..30909e4c4 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -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);