Added support for using protocol buffers (currently disabled and untested).

This commit is contained in:
Richard Helgeby 2013-01-23 22:48:31 +01:00
parent 6de9b9de13
commit a3a9748131

View File

@ -139,14 +139,33 @@ VEffectsCreateExplosion(const Float:origin[3], flags)
*/ */
VEffectsShakeClientScreen(client, Float:amplitude, Float:frequency, Float:duration) VEffectsShakeClientScreen(client, Float:amplitude, Float:frequency, Float:duration)
{ {
// If shake usermsg isn't invalid, then stop.
new Handle:hShake = StartMessageOne("Shake", client); new Handle:hShake = StartMessageOne("Shake", client);
// Validate.
if (hShake == INVALID_HANDLE) if (hShake == INVALID_HANDLE)
{ {
return; 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); BfWriteByte(hShake, 0);
BfWriteFloat(hShake, amplitude); BfWriteFloat(hShake, amplitude);
BfWriteFloat(hShake, frequency); BfWriteFloat(hShake, frequency);