]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use a cleaner switch for the weapon frames
authorMario <mario@smbclan.net>
Mon, 3 Jul 2017 14:59:51 +0000 (00:59 +1000)
committerMario <mario@smbclan.net>
Mon, 3 Jul 2017 14:59:51 +0000 (00:59 +1000)
qcsrc/common/weapons/all.qc

index 37c6724dd452b67601311eeb44b8715bd4ceb471..3bf72b0b6c4d70a10a1fb7c5f70fd81ddcda1d66 100644 (file)
@@ -576,11 +576,14 @@ NET_HANDLE(wframe, bool isNew)
        bool restartanim = ReadByte();
        entity wepent = viewmodels[slot];
        vector a = '0 0 0';
-    if (fr == WFRAME_IDLE) a = wepent.anim_idle;
-    else if (fr == WFRAME_FIRE1) a = wepent.anim_fire1;
-    else if (fr == WFRAME_FIRE2) a = wepent.anim_fire2;
-    else  // if (fr == WFRAME_RELOAD)
-        a = wepent.anim_reload;
+       switch(fr)
+       {
+               case WFRAME_IDLE:   a = wepent.anim_idle; break;
+               case WFRAME_FIRE1:  a = wepent.anim_fire1; break;
+               case WFRAME_FIRE2:  a = wepent.anim_fire2; break;
+               default:
+               case WFRAME_RELOAD: a = wepent.anim_reload; break;
+       }
     a.z *= wrate;
 
     //LOG_INFO(vtos(a), " ", ftos(fr), " ", ftos(wrate), "\n");