From: Mario Date: Mon, 3 Jul 2017 14:59:51 +0000 (+1000) Subject: Use a cleaner switch for the weapon frames X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d4a6cf1bbd3717c9c1c0e5562dec40ae761c0b8;p=xonotic%2Fxonotic-data.pk3dir.git Use a cleaner switch for the weapon frames --- diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 37c6724dd..3bf72b0b6 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -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");