X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ffunc%2Fdoor.qc;h=2dcd2333d214f3137a0de938a1fe9582524b9906;hb=5ab11184e635c257a13355f1319dbf208bce4d20;hp=05fafa4f026dc0ab881e12a28b6a87ca911dbfed;hpb=f8da4c3a82ee2899e90c84af196ca0f530ac5447;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 05fafa4f0..2dcd2333d 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -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) @@ -653,12 +657,25 @@ void door_init_shared(entity this) } // TODO: other soundpacks - if (this.sounds > 0) + if (this.sounds > 0 || q3compat) { + // Doors in Q3 always have sounds (they're hard coded) this.noise2 = "plats/medplat1.wav"; this.noise1 = "plats/medplat2.wav"; } + if (q3compat) + { + // CPMA adds these fields for overriding the engine sounds + string s = GetField_fullspawndata(this, "sound_start", true); + string e = GetField_fullspawndata(this, "sound_end", true); + + if (s) + this.noise2 = strzone(s); + if (e) + this.noise1 = strzone(e); + } + // sound when door stops moving if(this.noise1 && this.noise1 != "") { @@ -670,14 +687,14 @@ void door_init_shared(entity this) precache_sound(this.noise2); } - if(autocvar_sv_doors_always_open) - { - this.wait = -1; - } - else if (!this.wait) - { - this.wait = 3; - } + if(autocvar_sv_doors_always_open) + { + this.wait = -1; + } + else if (!this.wait) + { + this.wait = 3; + } if (!this.lip) { @@ -686,7 +703,7 @@ void door_init_shared(entity this) this.state = STATE_BOTTOM; - if (GetResource(this, RES_HEALTH)) + if (GetResource(this, RES_HEALTH) || (q3compat && this.targetname == "")) { //this.canteamdamage = true; // TODO this.takedamage = DAMAGE_YES; @@ -731,17 +748,17 @@ spawnfunc(func_door) this.pos1 = this.origin; this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip); - if(autocvar_sv_doors_always_open) - { - this.speed = max(750, this.speed); - } - else if (!this.speed) - { - if (autocvar_sv_q3defragcompat) + if(autocvar_sv_doors_always_open) + { + this.speed = max(750, this.speed); + } + else if (!this.speed) + { + if (q3compat) this.speed = 400; else - this.speed = 100; - } + this.speed = 100; + } settouch(this, door_touch);