Skip to content

Commit

Permalink
ReGameDLL API: Implement API for StartDeathCam (#162)
Browse files Browse the repository at this point in the history
* ReGameDLL API: Implement API for StartDeathCam
* Fix API minor version, related to 90d08ee
* Increment API minor version in gradle.properties
  • Loading branch information
In-line authored and s1lentq committed Jun 25, 2017
1 parent 1dc4849 commit efea014
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,3 +1,3 @@
majorVersion=5
minorVersion=2
minorVersion=3
maintenanceVersion=0
5 changes: 4 additions & 1 deletion regamedll/dlls/player.cpp
Expand Up @@ -3735,9 +3735,12 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(RoundRespawn)()

}


LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, StartDeathCam)

// StartDeathCam - find an intermission spot and send the
// player off into observer mode
void CBasePlayer::StartDeathCam()
void EXT_FUNC CBasePlayer::__API_HOOK(StartDeathCam)()
{
#ifdef REGAMEDLL_FXIES
m_canSwitchObserverModes = true;
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/player.h
Expand Up @@ -505,6 +505,7 @@ class CBasePlayer: public CBaseMonster {
void SetWeaponAnimType(const char *szExtention) { Q_strcpy(m_szAnimExtention, szExtention); }
void CheatImpulseCommands(int iImpulse);
void StartDeathCam();
void StartDeathCam_();
void StartObserver(Vector &vecPosition, Vector &vecViewAngle);
void StartObserver_(Vector &vecPosition, Vector &vecViewAngle);
void HandleSignals();
Expand Down
7 changes: 6 additions & 1 deletion regamedll/extra/cssdk/dlls/regamedll_api.h
Expand Up @@ -36,7 +36,7 @@
#include "items.h"

#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 1
#define REGAMEDLL_API_VERSION_MINOR 3

// CBasePlayer::Spawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
Expand Down Expand Up @@ -358,6 +358,10 @@ typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEn
typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound;

// CBasePlayer::StartDeathCam hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;

class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
Expand Down Expand Up @@ -447,6 +451,7 @@ class IReGameHookchains {
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd* CSGameRules_OnRoundFreezeEnd() = 0;
virtual IReGameHookRegistry_PM_UpdateStepSound* PM_UpdateStepSound() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartDeathCam* CBasePlayer_StartDeathCam() = 0;
};

struct ReGameFuncs_t {
Expand Down
1 change: 1 addition & 0 deletions regamedll/extra/cssdk/dlls/regamedll_interfaces.h
Expand Up @@ -95,6 +95,7 @@ class CCSPlayer: public CCSMonster {
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
virtual void StartDeathCam();

CBasePlayer *BasePlayer() const;
public:
Expand Down
7 changes: 6 additions & 1 deletion regamedll/public/regamedll/regamedll_api.h
Expand Up @@ -36,7 +36,7 @@
#include "items.h"

#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 2
#define REGAMEDLL_API_VERSION_MINOR 3

// CBasePlayer::Spawn hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
Expand Down Expand Up @@ -358,6 +358,10 @@ typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_OnRoundFreezeEn
typedef IHookChain<void> IReGameHook_PM_UpdateStepSound;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_UpdateStepSound;

// CBasePlayer::StartDeathCam hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;

class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
Expand Down Expand Up @@ -447,6 +451,7 @@ class IReGameHookchains {
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0;
virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd* CSGameRules_OnRoundFreezeEnd() = 0;
virtual IReGameHookRegistry_PM_UpdateStepSound* PM_UpdateStepSound() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartDeathCam* CBasePlayer_StartDeathCam() = 0;
};

struct ReGameFuncs_t {
Expand Down
1 change: 1 addition & 0 deletions regamedll/public/regamedll/regamedll_interfaces.h
Expand Up @@ -84,6 +84,7 @@ class CCSPlayer: public CCSMonster {
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
virtual void SwitchTeam();
virtual bool JoinTeam(TeamName team);
virtual void StartDeathCam();
virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle);
virtual void TeamChangeUpdate();
virtual void DropSecondary();
Expand Down
1 change: 1 addition & 0 deletions regamedll/regamedll/regamedll_api_impl.cpp
Expand Up @@ -140,6 +140,7 @@ GAMEHOOK_REGISTRY(CSGameRules_GoToIntermission);
GAMEHOOK_REGISTRY(CSGameRules_BalanceTeams);
GAMEHOOK_REGISTRY(CSGameRules_OnRoundFreezeEnd);
GAMEHOOK_REGISTRY(PM_UpdateStepSound);
GAMEHOOK_REGISTRY(CBasePlayer_StartDeathCam);

int EXT_FUNC CReGameApi::GetMajorVersion() {
return REGAMEDLL_API_VERSION_MAJOR;
Expand Down
6 changes: 6 additions & 0 deletions regamedll/regamedll/regamedll_api_impl.h
Expand Up @@ -354,6 +354,10 @@ typedef IHookChainRegistryClassEmptyImpl<void, class CHalfLifeMultiplay> CReGame
typedef IHookChainImpl<void> CReGameHook_PM_UpdateStepSound;
typedef IHookChainRegistryImpl<void> CReGameHookRegistry_PM_UpdateStepSound;

// CBasePlayer::StartDeathCam hook
typedef IHookChainClassImpl<void, CBasePlayer> CReGameHook_CBasePlayer_StartDeathCam;
typedef IHookChainRegistryClassImpl<void, CBasePlayer> CReGameHookRegistry_CBasePlayer_StartDeathCam;

class CReGameHookchains: public IReGameHookchains {
public:
// CBasePlayer virtual
Expand Down Expand Up @@ -441,6 +445,7 @@ class CReGameHookchains: public IReGameHookchains {
CReGameHookRegistry_CSGameRules_BalanceTeams m_CSGameRules_BalanceTeams;
CReGameHookRegistry_CSGameRules_OnRoundFreezeEnd m_CSGameRules_OnRoundFreezeEnd;
CReGameHookRegistry_PM_UpdateStepSound m_PM_UpdateStepSound;
CReGameHookRegistry_CBasePlayer_StartDeathCam m_CBasePlayer_StartDeathCam;

public:
virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn();
Expand Down Expand Up @@ -527,6 +532,7 @@ class CReGameHookchains: public IReGameHookchains {
virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams();
virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd* CSGameRules_OnRoundFreezeEnd();
virtual IReGameHookRegistry_PM_UpdateStepSound* PM_UpdateStepSound();
virtual IReGameHookRegistry_CBasePlayer_StartDeathCam* CBasePlayer_StartDeathCam();
};

extern CReGameHookchains g_ReGameHookchains;
Expand Down
1 change: 1 addition & 0 deletions regamedll/regamedll/regamedll_interfaces_impl.cpp
Expand Up @@ -331,3 +331,4 @@ void EXT_FUNC CCSPlayer::Disappear() { BasePlayer()->Disappear(); }
void EXT_FUNC CCSPlayer::MakeVIP() { BasePlayer()->MakeVIP(); }
bool EXT_FUNC CCSPlayer::MakeBomber() { return BasePlayer()->MakeBomber(); }
void EXT_FUNC CCSPlayer::ResetSequenceInfo() { BasePlayer()->ResetSequenceInfo(); }
void EXT_FUNC CCSPlayer::StartDeathCam() { BasePlayer()->StartDeathCam(); }

0 comments on commit efea014

Please sign in to comment.