From: Mario Date: Sat, 4 Feb 2017 14:14:37 +0000 (+1000) Subject: Adjust scaling of weapon's alpha value to work at much lower values X-Git-Tag: xonotic-v0.8.2~247 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8136be74ba569147bfd179727ade7fb6e02f82e;p=xonotic%2Fxonotic-data.pk3dir.git Adjust scaling of weapon's alpha value to work at much lower values --- diff --git a/qcsrc/common/wepent.qc b/qcsrc/common/wepent.qc index e244e7b7c..8d74a7b32 100644 --- a/qcsrc/common/wepent.qc +++ b/qcsrc/common/wepent.qc @@ -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); }, \