From: bones_was_here Date: Sat, 8 Oct 2022 09:38:56 +0000 (+1000) Subject: func_door: simplify DOOR_START_OPEN implementation X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1703040d43a76f7a168dd6b2b3f159b8d4fba06b;p=xonotic%2Fxonotic-data.pk3dir.git func_door: simplify DOOR_START_OPEN implementation --- diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 4e081bfb70..1e8dcec700 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -620,9 +620,10 @@ void door_init_startopen(entity this) this.pos2 = this.pos1; this.pos1 = this.origin; -#ifdef SVQC - this.SendFlags |= SF_TRIGGER_UPDATE; -#endif +// no longer needed: not using delayed initialisation for door_init_startopen() +//#ifdef SVQC +// this.SendFlags |= SF_TRIGGER_UPDATE; +//#endif } void door_reset(entity this) @@ -749,11 +750,6 @@ spawnfunc(func_door) if(this.spawnflags & DOOR_NONSOLID) this.solid = SOLID_NOT; -// DOOR_START_OPEN is to allow an entity to be lighted in the closed position -// but spawn in the open position - if (this.spawnflags & DOOR_START_OPEN) - InitializeEntity(this, door_init_startopen, INITPRIO_SETLOCATION); - door_init_shared(this); this.pos1 = this.origin; @@ -763,6 +759,11 @@ spawnfunc(func_door) absmovedir.z = fabs(this.movedir.z); this.pos2 = this.pos1 + this.movedir * (absmovedir * this.size - this.lip); +// DOOR_START_OPEN is to allow an entity to be lighted in the closed position +// but spawn in the open position + if (this.spawnflags & DOOR_START_OPEN) + door_init_startopen(this); + if(autocvar_sv_doors_always_open) { this.speed = max(750, this.speed); diff --git a/qcsrc/common/mapobjects/func/door.qh b/qcsrc/common/mapobjects/func/door.qh index f185f4be8f..d760921c96 100644 --- a/qcsrc/common/mapobjects/func/door.qh +++ b/qcsrc/common/mapobjects/func/door.qh @@ -4,7 +4,7 @@ bool autocvar_sv_doors_always_open; #endif -const int DOOR_START_OPEN = BIT(0); +const int DOOR_START_OPEN = BIT(0); // has same meaning in Q3: reverse position 1 and 2 const int DOOR_DONT_LINK = BIT(2); const int SPAWNFLAGS_GOLD_KEY = BIT(3); // Quake 1 compat, can only be used with func_door! const int SPAWNFLAGS_SILVER_KEY = BIT(4); // Quake 1 compat, can only be used with func_door!