string W_Sound(string w_snd)
{
- #define extensions(X) X(wav) X(ogg)
- #define tryext(ext) { if (fexists(strcat("sound/", output = strcat("weapons/", w_snd, "." #ext)))) break; }
- string output;
- do
- {
- extensions(tryext);
-#undef tryext
-#undef extensions
- output = strcat("weapons/", w_snd);
- }
- while (0);
-
+ string output = strcat("weapons/", w_snd);
#ifdef SVQC
MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
return weapon_sound_output;
#ifndef MENUQC
-REGISTER_NET_TEMP(wframe, bool isNew)
+REGISTER_NET_TEMP(wframe)
#ifdef CSQC
+NET_HANDLE(wframe, bool isNew)
{
vector a;
a.x = ReadCoord();
a.z = ReadCoord();
bool restartanim = ReadByte();
setanim(viewmodel, a, restartanim == false, restartanim, restartanim);
+ viewmodel.state = ReadByte();
+ viewmodel.alpha = ReadByte() / 255;
+ return true;
}
#endif
#ifdef SVQC
-void wframe_send(entity actor, vector a, bool restartanim)
+void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim)
{
if (!IS_REAL_CLIENT(actor)) return;
int channel = MSG_ONE;
WriteCoord(channel, a.y);
WriteCoord(channel, a.z);
WriteByte(channel, restartanim);
+ WriteByte(channel, weaponentity.state);
+ WriteByte(channel, weaponentity.alpha * 255);
+}
+#endif
+
+REGISTER_NET_TEMP(wglow)
+#ifdef CSQC
+NET_HANDLE(wglow, bool isNew)
+{
+ vector g = '0 0 0';
+ g.x = ReadCoord();
+ g.y = ReadCoord();
+ g.z = ReadCoord();
+ viewmodel.glowmod = g;
+ return true;
+}
+#endif
+
+#ifdef SVQC
+void wglow_send(entity actor, vector g)
+{
+ if (!IS_REAL_CLIENT(actor)) return;
+ int channel = MSG_ONE;
+ msg_entity = actor;
+ WriteHeader(channel, wglow);
+ WriteCoord(channel, g.x);
+ WriteCoord(channel, g.y);
+ WriteCoord(channel, g.z);
}
#endif