From: Mario Date: Sun, 19 Jan 2020 00:18:59 +0000 (+1000) Subject: Allow mappers to define the draw distance of the rain brush, useful for extra large... X-Git-Tag: xonotic-v0.8.5~1161^2~4^2 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=973d3d504418dd5a996aa907bd237ada8e23a531;p=xonotic%2Fxonotic-data.pk3dir.git Allow mappers to define the draw distance of the rain brush, useful for extra large maps where the default distance may be too much --- diff --git a/qcsrc/common/mapobjects/func/rainsnow.qc b/qcsrc/common/mapobjects/func/rainsnow.qc index 1cce5f5c2..4f4d4d0ac 100644 --- a/qcsrc/common/mapobjects/func/rainsnow.qc +++ b/qcsrc/common/mapobjects/func/rainsnow.qc @@ -13,6 +13,7 @@ bool rainsnow_SendEntity(entity this, entity to, float sf) WriteShort(MSG_ENTITY, compressShortVector(this.dest)); WriteShort(MSG_ENTITY, this.count); WriteByte(MSG_ENTITY, this.cnt); + WriteShort(MSG_ENTITY, bound(0, this.fade_end, 65535)); return true; } @@ -99,7 +100,8 @@ float autocvar_cl_rainsnow_maxdrawdist = 1000; void Draw_RainSnow(entity this) { - vector maxdist = '1 1 1' * autocvar_cl_rainsnow_maxdrawdist; + float drawdist = ((this.fade_end) ? this.fade_end : autocvar_cl_rainsnow_maxdrawdist); + vector maxdist = '1 1 1' * drawdist; vector effbox_min = vec_to_max(view_origin - maxdist, this.origin + this.mins); vector effbox_max = vec_to_min(view_origin + maxdist, this.origin + this.maxs); @@ -124,6 +126,7 @@ NET_HANDLE(ENT_CLIENT_RAINSNOW, bool isnew) this.velocity = decompressShortVector(ReadShort()); this.count = ReadShort(); this.glow_color = ReadByte(); // color + this.fade_end = ReadShort(); return = true;