]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
If the weapon's animation was invalid, reset it to idle, also default to the idle...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index 59812425d674cbe83100c535b2e40b02a1d8dac7..5f4f6f8332deb1d0b4d171c31a839922b4267bd3 100644 (file)
@@ -366,6 +366,9 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(
        bool restartanim;
        if (fr == WFRAME_DONTCHANGE)
        {
+               // this can happen when the weapon entity is newly spawned, since it has a clear state and no previous weapon frame
+               if (this.wframe == WFRAME_DONTCHANGE)
+                       this.wframe = WFRAME_IDLE;
                fr = this.wframe;
                restartanim = false;
        }