Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions regamedll/dlls/API/CAPI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,66 @@ CGrenade *EXT_FUNC SpawnGrenade_api(WeaponIdType weaponId, entvars_t *pevOwner,
return nullptr;
}

int EXT_FUNC UTIL_SharedRandomLong_api(unsigned int seed, int low, int high)
{
return UTIL_SharedRandomLong(seed, low, high);
}

float EXT_FUNC UTIL_SharedRandomFloat_api(unsigned int seed, float low, float high)
{
return UTIL_SharedRandomFloat(seed, low, high);
}

void EXT_FUNC UTIL_SetGroupTrace_api(int groupmask, int op)
{
UTIL_SetGroupTrace(groupmask, op);
}

void EXT_FUNC UTIL_UnsetGroupTrace_api()
{
UTIL_UnsetGroupTrace();
}

int EXT_FUNC UTIL_EntitiesInBox_api(CBaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask)
{
return UTIL_EntitiesInBox(pList, listMax, mins, maxs, flagMask);
}

void EXT_FUNC UTIL_ScreenShake_api(const Vector &center, float amplitude, float frequency, float duration, float radius)
{
UTIL_ScreenShake(center, amplitude, frequency, duration, radius);
}

void EXT_FUNC UTIL_ScreenFadeAll_api(const Vector &color, float fadeTime, float fadeHold, int alpha, int flags)
{
UTIL_ScreenFadeAll(color, fadeTime, fadeHold, alpha, flags);
}

void EXT_FUNC UTIL_ScreenFade_api(CBaseEntity *pEntity, const Vector &color, float fadeTime, float fadeHold, int alpha, int flags)
{
UTIL_ScreenFade(pEntity, color, fadeTime, fadeHold, alpha, flags);
}

float EXT_FUNC UTIL_WaterLevel_api(const Vector &position, float minz, float maxz)
{
return UTIL_WaterLevel(position, minz, maxz);
}

void EXT_FUNC UTIL_Bubbles_api(Vector mins, Vector maxs, int count)
{
UTIL_Bubbles(mins, maxs, count);
}

void EXT_FUNC UTIL_BubbleTrail_api(Vector from, Vector to, int count)
{
UTIL_BubbleTrail(from, to, count);
}

char EXT_FUNC UTIL_TextureHit_api(TraceResult *ptr, Vector vecSrc, Vector vecEnd)
{
return UTIL_TextureHit(ptr, vecSrc, vecEnd);
}

ReGameFuncs_t g_ReGameApiFuncs = {
CREATE_NAMED_ENTITY,

Expand Down Expand Up @@ -176,6 +236,19 @@ ReGameFuncs_t g_ReGameApiFuncs = {
TextureTypePlaySound_api,
CreateWeaponBox_api,
SpawnGrenade_api,

UTIL_SharedRandomLong_api,
UTIL_SharedRandomFloat_api,
UTIL_SetGroupTrace_api,
UTIL_UnsetGroupTrace_api,
UTIL_EntitiesInBox_api,
UTIL_ScreenShake_api,
UTIL_ScreenFadeAll_api,
UTIL_ScreenFade_api,
UTIL_WaterLevel_api,
UTIL_Bubbles_api,
UTIL_BubbleTrail_api,
UTIL_TextureHit_api,
};

GAMEHOOK_REGISTRY(CBasePlayer_Spawn);
Expand Down
14 changes: 13 additions & 1 deletion regamedll/public/regamedll/regamedll_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <API/CSInterfaces.h>

#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 30
#define REGAMEDLL_API_VERSION_MINOR 31

// CBasePlayer::Spawn hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
Expand Down Expand Up @@ -826,6 +826,18 @@ struct ReGameFuncs_t {
void (*TextureTypePlaySound)(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType);
class CWeaponBox *(*CreateWeaponBox)(CBasePlayerItem *pItem, CBasePlayer *pPlayerOwner, const char *modelName, Vector &origin, Vector &angles, Vector &velocity, float lifeTime, bool packAmmo);
class CGrenade *(*SpawnGrenade)(WeaponIdType weaponId, entvars_t *pevOwner, Vector &vecSrc, Vector &vecThrow, float time, int iTeam, unsigned short usEvent);
int (*UTIL_SharedRandomLong)(unsigned int seed, int low, int high);
float (*UTIL_SharedRandomFloat)(unsigned int seed, float low, float high);
void (*UTIL_SetGroupTrace)(int groupmask, int op);
void (*UTIL_UnsetGroupTrace)();
int (*UTIL_EntitiesInBox)(CBaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask);
void (*UTIL_ScreenShake)(const Vector &center, float amplitude, float frequency, float duration, float radius);
void (*UTIL_ScreenFadeAll)(const Vector &color, float fadeTime, float fadeHold, int alpha, int flags);
void (*UTIL_ScreenFade)(CBaseEntity *pEntity, const Vector &color, float fadeTime, float fadeHold, int alpha, int flags);
float (*UTIL_WaterLevel)(const Vector &position, float minz, float maxz);
void (*UTIL_Bubbles)(Vector mins, Vector maxs, int count);
void (*UTIL_BubbleTrail)(Vector from, Vector to, int count);
char (*UTIL_TextureHit)(TraceResult *ptr, Vector vecSrc, Vector vecEnd);
};

class IReGameApi {
Expand Down
2 changes: 1 addition & 1 deletion regamedll/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
#pragma once

#define VERSION_MAJOR 5
#define VERSION_MINOR 30
#define VERSION_MINOR 31
#define VERSION_MAINTENANCE 0