]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/all.qc
Fix weapon attack animations getting cut short by the animtime setting, and allow...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / all.qc
index f4a4de7f3fbabc70514310848d551d5cfcab1a92..a694112ce6672ab57a176fc720b8df8c7ace4a5e 100644 (file)
@@ -204,7 +204,7 @@ void W_RandomWeapons(entity e, float n)
                RandomSelection_Init();
                FOREACH(Weapons, it != WEP_Null, {
                        if (remaining & (it.m_wepset))
-                               RandomSelection_Add(it, 0, string_null, 1, 1);
+                               RandomSelection_AddEnt(it, 1, 1);
                });
                Weapon w = RandomSelection_chosen_ent;
                result |= WepSet_FromWeapon(w);
@@ -566,7 +566,10 @@ NET_HANDLE(wframe, bool isNew)
     int slot = ReadByte();
        bool restartanim = ReadByte();
        entity wepent = viewmodels[slot];
-       anim_set(wepent, a, !restartanim, restartanim, restartanim);
+       if(a.x == wepent.anim_idle_x) // we don't need to enforce idle animation
+               wepent.animstate_looping = false;
+       else
+               anim_set(wepent, a, !restartanim, restartanim, restartanim);
        wepent.state = ReadByte();
        wepent.weapon_nextthink = ReadFloat();
        switch (wepent.state)