From 665605e0abb4a68a9b0fc9eb75056d154ce0459d Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 7 Jan 2016 18:46:34 +0600 Subject: [PATCH] ReHLDS API: Added functions SetResourcesNum and GetResourcesAt for the API. --- rehlds/public/rehlds/rehlds_interfaces.h | 2 ++ rehlds/rehlds/rehlds_interfaces_impl.cpp | 8 ++++++++ rehlds/rehlds/rehlds_interfaces_impl.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/rehlds/public/rehlds/rehlds_interfaces.h b/rehlds/public/rehlds/rehlds_interfaces.h index d30af0f..d740b03 100644 --- a/rehlds/public/rehlds/rehlds_interfaces.h +++ b/rehlds/public/rehlds/rehlds_interfaces.h @@ -123,4 +123,6 @@ public: virtual int GetDecalNameNum() = 0; virtual double GetTime() = 0; + virtual void SetResourcesNum(int num) = 0; + virtual struct resource_s *GetResource(int index) = 0; }; diff --git a/rehlds/rehlds/rehlds_interfaces_impl.cpp b/rehlds/rehlds/rehlds_interfaces_impl.cpp index a9fff47..d7814e6 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.cpp +++ b/rehlds/rehlds/rehlds_interfaces_impl.cpp @@ -230,6 +230,14 @@ double EXT_FUNC CRehldsServerData::GetTime() { return g_psv.time; } +void EXT_FUNC CRehldsServerData::SetResourcesNum(int num) { + g_psv.num_resources = num; +} + +struct resource_s *EXT_FUNC CRehldsServerData::GetResource(int index) { + return &g_psv.resourcelist[index]; +} + void Rehlds_Interfaces_FreeClients() { if (g_GameClients == NULL) diff --git a/rehlds/rehlds/rehlds_interfaces_impl.h b/rehlds/rehlds/rehlds_interfaces_impl.h index 23aff4f..acb5dcd 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.h +++ b/rehlds/rehlds/rehlds_interfaces_impl.h @@ -117,6 +117,8 @@ public: virtual int GetDecalNameNum(); virtual double GetTime(); + virtual void SetResourcesNum(int num); + virtual struct resource_s *GetResource(int index); }; extern CGameClient** g_GameClients;