]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't set the weaponmodel every frame (Fixes Issue #1790)
authorFreddy <schro.sb@gmail.com>
Tue, 16 Aug 2016 20:40:14 +0000 (22:40 +0200)
committerFreddy <schro.sb@gmail.com>
Tue, 16 Aug 2016 20:40:14 +0000 (22:40 +0200)
Also disable the reload animation for switching to tuba alternatives,
it will only play after the form is already switched and is way to long anyways

qcsrc/client/view.qc
qcsrc/common/weapons/weapon/tuba.qc

index 339d05209d2e891dbc195458fecfd2ed7574838e..7f1ef2ce901a4e364c6278cab2cb0daad0c0b9b7 100644 (file)
@@ -312,7 +312,7 @@ void viewmodel_draw(entity this)
                static string name_last;
                string name = wep.mdl;
                bool swap = name != name_last;
-               // if (swap)
+               if (swap)
                {
                        name_last = name;
                        CL_WeaponEntity_SetModel(this, name, swap);
index 31d2bf7a6299fcf735df432d93fa931ee31caf0d..b9c1554b9be09d7ae785e8708ca780cef3fbb217 100644 (file)
@@ -451,7 +451,10 @@ METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity))
                W_SetupShot(actor, weaponentity, false, 0, SND_Null, 0, 0);
                Send_Effect(EFFECT_TELEPORT, w_shotorg, '0 0 0', 1);
                actor.(weaponentity).state = WS_INUSE;
-               weapon_thinkf(actor, weaponentity, WFRAME_RELOAD, 0.5, w_ready);
+               // TODO: don't show the reload animation cause the weapon is already switched
+               // switch animations need a better system
+//             weapon_thinkf(actor, weaponentity, WFRAME_RELOAD, 0.5, w_ready);
+               weapon_thinkf(actor, weaponentity, WFRAME_IDLE, 0.5, w_ready);
        }
 }
 #endif