From a3a9748131753d30c9ca499f18643b13fc8d5ecd Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Wed, 23 Jan 2013 22:48:31 +0100 Subject: [PATCH] Added support for using protocol buffers (currently disabled and untested). --- src/zr/visualeffects/visualeffects.inc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/zr/visualeffects/visualeffects.inc b/src/zr/visualeffects/visualeffects.inc index 1356975..5a5288b 100644 --- a/src/zr/visualeffects/visualeffects.inc +++ b/src/zr/visualeffects/visualeffects.inc @@ -139,14 +139,33 @@ VEffectsCreateExplosion(const Float:origin[3], flags) */ VEffectsShakeClientScreen(client, Float:amplitude, Float:frequency, Float:duration) { - // If shake usermsg isn't invalid, then stop. new Handle:hShake = StartMessageOne("Shake", client); + + // Validate. if (hShake == INVALID_HANDLE) { return; } - // Write shake information to usermsg handle. + // Future code using protocol buffers (not tested). Enabling this will bump + // SourceMod version requirement to a snapshot, we don't want to do that + // until that branch is declared stable. + /*if (GetUserMessageType() == UM_Protobuf) + { + PbSetInt(hShake, "command", 0); + PbSetFloat(hShake, "local_amplitude", amplitude); + PbSetFloat(hShake, "frequency", frequency); + PbSetFloat(hShake, "duration", duration); + } + else + { + BfWriteByte(hShake, 0); + BfWriteFloat(hShake, amplitude); + BfWriteFloat(hShake, frequency); + BfWriteFloat(hShake, duration); + }*/ + + // Write shake information to message handle. BfWriteByte(hShake, 0); BfWriteFloat(hShake, amplitude); BfWriteFloat(hShake, frequency);