2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Added SetModelName function to ReHLDS API

This commit is contained in:
WPMGPRoSToTeMa 2015-07-13 02:00:34 +03:00
parent 131d43a15e
commit db2c7c7c10
4 changed files with 10 additions and 1 deletions

View File

@ -35,7 +35,7 @@
#include "model.h"
#define REHLDS_API_VERSION_MAJOR 1
#define REHLDS_API_VERSION_MINOR 2
#define REHLDS_API_VERSION_MINOR 3
//Steam_NotifyClientConnect hook
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;

View File

@ -108,4 +108,6 @@ public:
virtual const char* GetName() = 0;
virtual uint32 GetWorldmapCrc() = 0;
virtual uint8* GetClientDllMd5() = 0;
virtual void SetModelName(const char* modelname) = 0;
};

View File

@ -161,6 +161,11 @@ const char* EXT_FUNC CRehldsServerData::GetModelName() {
return g_psv.modelname;
}
void EXT_FUNC CRehldsServerData::SetModelName(const char* modelname) {
Q_strncpy(g_psv.modelname, modelname, ARRAYSIZE(g_psv.modelname) - 1);
g_psv.modelname[ARRAYSIZE(g_psv.modelname) - 1] = '\0';
}
const char* EXT_FUNC CRehldsServerData::GetName() {
return g_psv.name;
}

View File

@ -96,6 +96,8 @@ public:
virtual const char* GetName();
virtual uint32 GetWorldmapCrc();
virtual uint8* GetClientDllMd5();
virtual void SetModelName(const char* modelname);
};
extern CGameClient** g_GameClients;