X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=b8d2428f3ff24ac9c30d6d1b26930bd2012a7b42;hb=b8880819e333ef558143ae80afcdb339b907a439;hp=ef7a38c4e27bb7979e16e3c7e547aaccbc025fe3;hpb=0eaaec01e120d39a564252ebc31a34d5ff114117;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index ef7a38c4e..b8d2428f3 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -565,14 +565,27 @@ REGISTER_NET_TEMP(wframe) #ifdef CSQC NET_HANDLE(wframe, bool isNew) { - vector a = ReadVector(); + int fr = ReadByte(); + float t = ReadFloat(); int slot = ReadByte(); bool restartanim = ReadByte(); entity wepent = viewmodels[slot]; - if(a.x == wepent.anim_idle_x) // we don't need to enforce idle animation - wepent.animstate_looping = false; + if(fr == WFRAME_IDLE) + wepent.animstate_looping = false; // we don't need to enforce idle animation else + { + vector a = '0 0 0'; + 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 *= t; anim_set(wepent, a, !restartanim, restartanim, restartanim); + } wepent.state = ReadByte(); wepent.weapon_nextthink = ReadFloat(); switch (wepent.state) @@ -592,13 +605,14 @@ NET_HANDLE(wframe, bool isNew) #endif #ifdef SVQC -void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim) +void wframe_send(entity actor, entity weaponentity, int wepframe, float attackrate, bool restartanim) { if (!IS_REAL_CLIENT(actor)) return; int channel = MSG_ONE; msg_entity = actor; WriteHeader(channel, wframe); - WriteVector(channel, a); + WriteByte(channel, wepframe); + WriteFloat(channel, attackrate); WriteByte(channel, weaponslot(weaponentity.weaponentity_fld)); WriteByte(channel, restartanim); WriteByte(channel, weaponentity.state);