]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix weapon attack animations getting cut short by the animtime setting, and allow... 411/head
authorMario <mario@smbclan.net>
Mon, 20 Feb 2017 08:50:55 +0000 (18:50 +1000)
committerMario <mario@smbclan.net>
Mon, 20 Feb 2017 08:50:55 +0000 (18:50 +1000)
qcsrc/client/view.qc
qcsrc/common/weapons/all.qc
qcsrc/server/weapons/weaponsystem.qc

index 8b96e6a269755e07f5d4175613ea5c5bc3b542f7..acdb69fdcd9276e3ba6551acb384ca40ad7ad42d 100644 (file)
@@ -326,7 +326,7 @@ void viewmodel_draw(entity this)
                        this.viewmodel_angles = this.angles;
                }
                anim_update(this);
-               if (!this.animstate_override && !this.animstate_looping)
+               if ((!this.animstate_override && !this.animstate_looping) || time > this.animstate_endtime)
                        anim_set(this, this.anim_idle, true, false, false);
        }
        float f = 0; // 0..1; 0: fully active
index c236bb47c4d3ef361bc5ac9705e88a78483d1933..a694112ce6672ab57a176fc720b8df8c7ace4a5e 100644 (file)
@@ -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)
index 3347f2bb1e2a78d30ac52746e744140275cbb534..1605db39d2228550b50bce4ab04041b7349e3cbe 100644 (file)
@@ -517,7 +517,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                                        this.clip_load = this.clip_size = 0;
                                }
 
-                               weapon_thinkf(actor, weaponentity, WFRAME_IDLE, newwep.switchdelay_raise, w_ready);
+                               weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, newwep.switchdelay_raise, w_ready);
                                break;
                        }
                        case WS_DROP: