Skip to content

Commit

Permalink
Add reserve members for CCS Entity
Browse files Browse the repository at this point in the history
Bump interface version up to CSENTITY_API_INTERFACE_VERSION003
  • Loading branch information
s1lentq committed Aug 24, 2023
1 parent 02bb06a commit f3723d7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions regamedll/dlls/cbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class CBaseEntity {

#ifdef REGAMEDLL_API
CCSEntity *m_pEntity;
CCSEntity *CSEntity() const;
#else
// We use this variables to store each ammo count.
// let's sacrifice this unused member, for its own needs in favor of m_pEntity
Expand Down Expand Up @@ -328,6 +329,13 @@ inline void CBaseEntity::SetBlocked(std::nullptr_t)
m_pfnBlocked = nullptr;
}

#ifdef REGAMEDLL_API
inline CCSEntity *CBaseEntity::CSEntity() const
{
return m_pEntity;
}
#endif

class CPointEntity: public CBaseEntity {
public:
virtual void Spawn();
Expand Down
13 changes: 11 additions & 2 deletions regamedll/public/regamedll/API/CSEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ class CCSEntity

private:
#if defined(_MSC_VER)
#pragma region reserve_vfuncs_Region
#pragma region reserve_data_Region
#endif
int CCSEntity_Reserve[0x1000];
virtual void func_reserve1() {};
virtual void func_reserve2() {};
virtual void func_reserve3() {};
Expand Down Expand Up @@ -88,24 +89,32 @@ class CCSDelay: public CCSEntity
{
public:

private:
int CCSDelay_Reserve[0x100];
};

class CCSAnimating: public CCSDelay
{
public:

private:
int CCSAnimating_Reserve[0x100];
};

class CCSToggle: public CCSAnimating
{
public:

private:
int CCSToggle_Reserve[0x100];
};

class CCSMonster: public CCSToggle
{
public:

private:
int CCSMonster_Reserve[0x100];
};

#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION002"
#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION003"

2 comments on commit f3723d7

@StevenKal
Copy link
Contributor

@StevenKal StevenKal commented on f3723d7 Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s1lentq:
Please do not use those hex shits numbers! We never instantly know how much is the size (my case, I have to waste time to go there), not simpler at all, and makes me angry! Just use "4096" or "256", it does not hurt!

@dystopm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s1lentq: Please do not use those hex shits numbers! We never instantly know how much is the size (my case, I have to waste time to go there), not simpler at all, and makes me angry! Just use "4096" or "256", it does not hurt!

Considering the fact @s1lentq has no responsability of your angriness, I think that he has so normalized under his knowledge in C++ the different numerical bases in programming that what he would least expect is that someone "claims" him to use HEX numbers on it. Instead, enclosing the number in a macro with a simple comment, may be a better fashioned way to implement this. In my case, I had no trouble in guessing 0x100 is 256 because I just knew it long time ago (and yeah, it's always good and simple to waste time going to a website to convert a magic number).

Ways and ways to propose changes 😄👌🏻

Please sign in to comment.