X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ffunc%2Fdoor.qc;h=30909e4c453cf03172dae866051677272b6d1e24;hb=3e095f0bd49bb0b8a6722133537c0240163e569a;hp=25e9ba844e75e89a5752569f2e81d2f061bd6b4f;hpb=6ececc748777df4af471949f462ead5c8b8ba1df;p=xonotic%2Fxonotic-data.pk3dir.git 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);