From 0da76d96aba13fe8a80f9c63c6ed9600d1b12914 Mon Sep 17 00:00:00 2001 From: Sam V Date: Sat, 4 Feb 2023 13:29:14 +0100 Subject: [PATCH] Add WRITE_FLOAT function corresponding to the client's READ_FLOAT function --- CHANGELOG.md | 1 + dlls/enginecallback.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5822b64..a107516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * Moved IsFacing function from barney.cpp to h_ai.cpp to help prevent linker errors when copy pasting source file * When using `impulse 107` to get the name of a texture the texture type (as used in `materials.txt`) will also be printed * Made `PM_FindTextureType` const correct +* Added `WRITE_FLOAT` function corresponding to the client's `READ_FLOAT` function ## Changes in V1.0.0 Beta 013 diff --git a/dlls/enginecallback.h b/dlls/enginecallback.h index 452e896..52becf1 100644 --- a/dlls/enginecallback.h +++ b/dlls/enginecallback.h @@ -82,6 +82,12 @@ inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float* pOrigin = NUL #define WRITE_COORD (*g_engfuncs.pfnWriteCoord) #define WRITE_STRING (*g_engfuncs.pfnWriteString) #define WRITE_ENTITY (*g_engfuncs.pfnWriteEntity) + +inline void WRITE_FLOAT(float value) +{ + WRITE_LONG(*reinterpret_cast(&value)); +} + #define CVAR_REGISTER (*g_engfuncs.pfnCVarRegister) #define CVAR_GET_FLOAT (*g_engfuncs.pfnCVarGetFloat) #define CVAR_GET_STRING (*g_engfuncs.pfnCVarGetString)