]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Adjust scaling of weapon's alpha value to work at much lower values
authorMario <mario@smbclan.net>
Sat, 4 Feb 2017 14:14:37 +0000 (00:14 +1000)
committerMario <mario@smbclan.net>
Sat, 4 Feb 2017 14:14:37 +0000 (00:14 +1000)
qcsrc/common/wepent.qc

index e244e7b7c9522b62848f3dc44e8567f82413a48b..8d74a7b3272ffc2da3ef3650fff42a223357cf16 100644 (file)
@@ -19,8 +19,8 @@ MACRO_END
        { (viewmodels[this.m_wepent_slot]).activeweapon = Weapons_from(ReadByte()); }) \
     \
     PROP(false, m_alpha, WEPENT_SET_NORMAL, \
-       { WriteByte(chan, this.m_alpha * 16); }, \
-       { (viewmodels[this.m_wepent_slot]).alpha = ReadByte() / 16; }) \
+       { WriteByte(chan, rint(bound(-1, 254 * this.m_alpha, 254) - -1)); }, \
+       { (viewmodels[this.m_wepent_slot]).alpha = (ReadByte() + -1) / 254; }) \
     \
     PROP(false, vortex_charge, WEPENT_SET_NORMAL, \
        { WriteByte(chan, this.vortex_charge * 16); }, \