X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Flib%2Fwarpzone%2Fclient.qc;h=df1ab6b806bf91e3b6d84e337d51fcee99dad8f2;hp=6467dad35a4d57b4fcebe762166b70216ef2fbec;hb=888995b630e97d6771e268a25b8027b0db607e04;hpb=834fed09016056ff2cd32d1980f0719d09c403a2 diff --git a/qcsrc/lib/warpzone/client.qc b/qcsrc/lib/warpzone/client.qc index 6467dad35a..df1ab6b806 100644 --- a/qcsrc/lib/warpzone/client.qc +++ b/qcsrc/lib/warpzone/client.qc @@ -25,9 +25,14 @@ void WarpZone_Fade_PreDraw(entity this) this.drawmask = MASK_NORMAL; } -void WarpZone_Touch (); +void WarpZone_Touch(entity this, entity toucher); NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew) { + if(!warpzone_warpzones_exist) + { + cvar_settemp("r_water", "1"); // HACK for DarkPlaces: always enable reflections when a map has warpzones + cvar_settemp("r_water_resolutionmultiplier", "1"); // HACK for DarkPlaces: enforce full quality so entities can be seen clearly through warpzones + } warpzone_warpzones_exist = 1; if (!this.enemy) { @@ -35,36 +40,25 @@ NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew) } this.classname = "trigger_warpzone"; + if(isnew) + IL_PUSH(g_warpzones, this); + int f = ReadByte(); this.warpzone_isboxy = (f & 1); if(f & 4) { - this.origin_x = ReadCoord(); - this.origin_y = ReadCoord(); - this.origin_z = ReadCoord(); + this.origin = ReadVector(); } else this.origin = '0 0 0'; this.modelindex = ReadShort(); - this.mins_x = ReadCoord(); - this.mins_y = ReadCoord(); - this.mins_z = ReadCoord(); - this.maxs_x = ReadCoord(); - this.maxs_y = ReadCoord(); - this.maxs_z = ReadCoord(); + this.mins = ReadVector(); + this.maxs = ReadVector(); this.scale = ReadByte() / 16; - this.enemy.oldorigin_x = ReadCoord(); - this.enemy.oldorigin_y = ReadCoord(); - this.enemy.oldorigin_z = ReadCoord(); - this.enemy.avelocity_x = ReadCoord(); - this.enemy.avelocity_y = ReadCoord(); - this.enemy.avelocity_z = ReadCoord(); - this.oldorigin_x = ReadCoord(); - this.oldorigin_y = ReadCoord(); - this.oldorigin_z = ReadCoord(); - this.avelocity_x = ReadCoord(); - this.avelocity_y = ReadCoord(); - this.avelocity_z = ReadCoord(); + this.enemy.oldorigin = ReadVector(); + this.enemy.avelocity = ReadVector(); + this.oldorigin = ReadVector(); + this.avelocity = ReadVector(); if(f & 2) { @@ -89,38 +83,33 @@ NET_HANDLE(ENT_CLIENT_WARPZONE, bool isnew) // engine currently wants this setpredraw(this, WarpZone_Fade_PreDraw); - //this.move_touch = WarpZone_Touch; + //settouch(this, WarpZone_Touch); return true; } NET_HANDLE(ENT_CLIENT_WARPZONE_CAMERA, bool isnew) { + if(!warpzone_cameras_exist) + { + cvar_settemp("r_water", "1"); // HACK for DarkPlaces: always enable reflections when a map has cameras + cvar_settemp("r_water_resolutionmultiplier", "1"); // HACK for DarkPlaces: enforce full quality so entities can be seen clearly through warpzones + } warpzone_cameras_exist = 1; this.classname = "func_warpzone_camera"; int f = ReadByte(); if(f & 4) { - this.origin_x = ReadCoord(); - this.origin_y = ReadCoord(); - this.origin_z = ReadCoord(); + this.origin = ReadVector(); } else this.origin = '0 0 0'; this.modelindex = ReadShort(); - this.mins_x = ReadCoord(); - this.mins_y = ReadCoord(); - this.mins_z = ReadCoord(); - this.maxs_x = ReadCoord(); - this.maxs_y = ReadCoord(); - this.maxs_z = ReadCoord(); + this.mins = ReadVector(); + this.maxs = ReadVector(); this.scale = ReadByte() / 16; - this.oldorigin_x = ReadCoord(); - this.oldorigin_y = ReadCoord(); - this.oldorigin_z = ReadCoord(); - this.avelocity_x = ReadCoord(); - this.avelocity_y = ReadCoord(); - this.avelocity_z = ReadCoord(); + this.oldorigin = ReadVector(); + this.avelocity = ReadVector(); if(f & 2) { @@ -154,10 +143,7 @@ void CL_RotateMoves(vector ang) = #638; NET_HANDLE(ENT_CLIENT_WARPZONE_TELEPORTED, bool isnew) { this.classname = "warpzone_teleported"; - vector v; - v.x = ReadCoord(); - v.y = ReadCoord(); - v.z = ReadCoord(); + vector v = ReadVector(); return = true; if (!isnew) return; this.warpzone_transform = v; @@ -241,7 +227,6 @@ void WarpZone_FixView() { entity e; vector org, ang, nearclip, corner0, corner1, corner2, corner3, o; - float f; warpzone_save_view_origin = org = getpropertyvec(VF_ORIGIN); warpzone_save_view_angles = ang = getpropertyvec(VF_ANGLES); @@ -258,10 +243,29 @@ void WarpZone_FixView() #ifndef KEEP_ROLL float rick; - if(autocvar_cl_rollkillspeed) - f = max(0, (1 - frametime * autocvar_cl_rollkillspeed)); - else + float f; + static float rollkill; + if (STAT(HEALTH) > 0 || STAT(HEALTH) == -666 || STAT(HEALTH) == -2342) + { f = 0; + // reset roll when passing through a warpzone that change player's roll angle + if(autocvar_cl_rollkillspeed) + f = max(0, (1 - frametime * autocvar_cl_rollkillspeed)); + if(rollkill) + rollkill = 0; + } + else + { + f = 1; + // roll the view when killed (v_deathtilt) + if(autocvar_cl_rollkillspeed) + { + rollkill += frametime * autocvar_cl_rollkillspeed; + f = min(1, rollkill); + } + else if(rollkill) + rollkill = 0; + } rick = getproperty(VF_CL_VIEWANGLES_Z); rick *= f;