]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix client model fade distance fields being limited to 255
authorMario <mario@smbclan.net>
Fri, 28 Sep 2018 10:25:57 +0000 (20:25 +1000)
committerMario <mario@smbclan.net>
Fri, 28 Sep 2018 10:26:26 +0000 (20:26 +1000)
qcsrc/common/mapobjects/models.qc

index 4f07409b10db1262a1fc992705a9a5c4361d81df..9fb61c230fac807e913d5293120cf329f449b15b 100644 (file)
@@ -148,10 +148,10 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf)
                        WriteVector(MSG_ENTITY, this.movedir);
                        WriteByte(MSG_ENTITY, floor(this.lip * 255));
                }
-               WriteByte(MSG_ENTITY, this.fade_start);
-               WriteByte(MSG_ENTITY, this.fade_end);
-               WriteByte(MSG_ENTITY, this.alpha_max);
-               WriteByte(MSG_ENTITY, this.alpha_min);
+               WriteShort(MSG_ENTITY, bound(0, this.fade_start, 65535));
+               WriteShort(MSG_ENTITY, bound(0, this.fade_end, 65535));
+               WriteByte(MSG_ENTITY, floor(this.alpha_max * 256));
+               WriteByte(MSG_ENTITY, floor(this.alpha_min * 256));
                WriteByte(MSG_ENTITY, this.inactive);
                WriteShort(MSG_ENTITY, this.fade_vertical_offset);
        }
@@ -390,10 +390,10 @@ NET_HANDLE(ENT_CLIENT_WALL, bool isnew)
                        this.movedir = ReadVector();
                        this.lip = ReadByte() / 255.0;
                }
-               this.fade_start = ReadByte();
-               this.fade_end = ReadByte();
-               this.alpha_max = ReadByte();
-               this.alpha_min = ReadByte();
+               this.fade_start = ReadShort();
+               this.fade_end = ReadShort();
+               this.alpha_max = ReadByte() / 255.0;
+               this.alpha_min = ReadByte() / 255.0;
                this.inactive = ReadByte();
                this.fade_vertical_offset = ReadShort();
                BGMScript_InitEntity(this);