2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 15:45:31 +03:00

Add rg_set_iteminfo/rg_get_iteminfo

Add member's CSPlayerWeapon
Refactoring amxx-sdk
This commit is contained in:
s1lent 2017-11-16 21:39:11 +07:00
parent f98571f217
commit cedb782419
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
28 changed files with 1787 additions and 547 deletions

View File

@ -128,7 +128,9 @@
#define EF_LIGHT 64 // Rocket flare glow sprite
#define EF_NODRAW 128 // Don't draw entity
// Break Model Defines
/**
* Break Model Defines
*/
#define BREAK_TYPEMASK 0x4F
#define BREAK_GLASS 0x01
#define BREAK_METAL 0x02
@ -140,7 +142,9 @@
#define BREAK_CONCRETE 0x40
#define BREAK_2 0x80
// Colliding temp entity sounds
/**
* Colliding temp entity sounds
*/
#define BOUNCE_GLASS BREAK_GLASS
#define BOUNCE_METAL BREAK_METAL
#define BOUNCE_FLESH BREAK_FLESH
@ -150,7 +154,9 @@
#define BOUNCE_CONCRETE BREAK_CONCRETE
#define BOUNCE_SHOTSHELL 0x80
// Temp entity bounce sound types
/**
* Temp entity bounce sound types
*/
#define TE_BOUNCE_NULL 0
#define TE_BOUNCE_SHELL 1
#define TE_BOUNCE_SHOTSHELL 2
@ -223,8 +229,10 @@
#define PFLAG_USING (1<<4) // Using a continuous entity
#define PFLAG_OBSERVER (1<<5) // Player is locked in stationary cam mode. Spectators can move, observers can't.
// Player HUD
// CBasePlayer::m_iHideHUD
/**
* Player HUD
* CBasePlayer::m_iHideHUD
*/
#define HIDEHUD_WEAPONS (1<<0)
#define HIDEHUD_FLASHLIGHT (1<<1)
#define HIDEHUD_ALL (1<<2)
@ -234,6 +242,15 @@
#define HIDEHUD_CROSSHAIR (1<<6)
#define HIDEHUD_OBSERVER_CROSSHAIR (1<<7)
/**
* Item's flags
*/
#define ITEM_FLAG_SELECTONEMPTY (1<<0)
#define ITEM_FLAG_NOAUTORELOAD (1<<1)
#define ITEM_FLAG_NOAUTOSWITCHEMPTY (1<<2)
#define ITEM_FLAG_LIMITINWORLD (1<<3)
#define ITEM_FLAG_EXHAUSTIBLE (1<<4)
/**
* @section get_entvar(entity, var_spawnflags) values
*/
@ -666,7 +683,9 @@
#define BLOOD_COLOR_YELLOW 195
#define BLOOD_COLOR_GREEN BLOOD_COLOR_YELLOW
// CBasePlayer::m_iIgnoreGlobalChat
/**
* CBasePlayer::m_iIgnoreGlobalChat
*/
enum
{
IGNOREMSG_NONE, // Nothing to do
@ -694,7 +713,9 @@ enum ArmorType
ARMOR_VESTHELM, // Vest and helmet
};
// For CArmoury::m_Armoury_iItem
/**
* For CArmoury::m_Armoury_iItem
*/
enum ArmouryItemPack
{
ARMOURY_MP5NAVY,
@ -826,7 +847,9 @@ enum WeaponIdType
WEAPON_SHIELDGUN = 99
};
// For member CBaseMonster::m_rgbTimeBasedDamage
/**
* For CBaseMonster::m_rgbTimeBasedDamage
*/
enum TimeBasedDamage
{
ITDB_PRALYZE,
@ -958,7 +981,9 @@ enum WinStatus
#define RR_ESCAPING_TERRORISTS_NEUTRALIZED RR_ESCAPING_TERRORISTS_NEUTR
#endif
// Used for EndRoundMessage() logged messages
/**
* Used for EndRoundMessage() logged messages
*/
enum ScenarioEventEndRound
{
ROUND_NONE,
@ -997,10 +1022,22 @@ enum PLAYER_ANIM
PLAYER_HOLDBOMB
};
// CBasePlayer::m_iJoiningState
enum JoinState { JOINED, SHOWLTEXT, READINGLTEXT, SHOWTEAMSELECT, PICKINGTEAM, GETINTOGAME };
/**
* For CBasePlayer::m_iJoiningState
*/
enum JoinState
{
JOINED,
SHOWLTEXT,
READINGLTEXT,
SHOWTEAMSELECT,
PICKINGTEAM,
GETINTOGAME
};
// CBasePlayer::m_iMenu
/**
* For CBasePlayer::m_iMenu
*/
enum _Menu
{
Menu_OFF,
@ -1020,7 +1057,9 @@ enum _Menu
Menu_ClientBuy
};
// CBasePlayer::m_flLastCommandTime[8]
/**
* For CBasePlayer::m_flLastCommandTime[8]
*/
enum TrackCommands
{
CMD_SAY,
@ -1034,7 +1073,9 @@ enum TrackCommands
COMMANDS_TO_TRACK,
};
// CBasePlayer::m_rgpPlayerItems[6]
/**
* For CBasePlayer::m_rgpPlayerItems[6]
*/
enum InventorySlotType
{
NONE_SLOT,
@ -1045,7 +1086,9 @@ enum InventorySlotType
C4_SLOT,
};
// Sets animation for weapon_shield of SendWeaponAnim
/**
* Sets animation for weapon_shield of SendWeaponAnim
*/
enum shieldgren_e
{
SHIELDREN_IDLE = 4,
@ -1066,7 +1109,9 @@ enum shieldgun_e
SHIELDGUN_DOWN,
};
// Flags for CUnifiedSignals m_signals
/**
* Flags for CUnifiedSignals m_signals
*/
enum SignalState
{
SIGNAL_BUY = BIT(0),
@ -1076,7 +1121,9 @@ enum SignalState
SIGNAL_VIPSAFETY = BIT(4),
};
// Weapon states of the following weapons: usp, elite, glock18, famas and m4a1.
/**
* Weapon states of the following weapons: usp, elite, glock18, famas and m4a1.
*/
enum WeaponState
{
WPNSTATE_USP_SILENCED = BIT(0),
@ -1141,7 +1188,9 @@ enum ItemRestType
ITEM_TYPE_EQUIPPED // When an entity game_player_equip gives item to player or default items on player spawn
};
// Constant items
/**
* Constant items
*/
enum ItemID
{
ITEM_NONE = -1,
@ -1187,7 +1236,9 @@ enum ItemID
ITEM_BATTERY
};
// CMapInfo:m_iBuyingStatus
/**
* For CMapInfo:m_iBuyingStatus
*/
enum InfoMapBuyParam
{
BUYING_EVERYONE = 0,

View File

@ -72,6 +72,7 @@ enum members_tables_e
mt_shield,
mt_rebuystruct,
mt_mapinfo,
mt_csplayerweapon
};
// Is like FNullEnt
@ -93,7 +94,9 @@ enum members_tables_e
#include <reapi_reunion>
#include <reapi_rechecker>
// hookchain return type
/**
* Hookchain return types
*/
enum
{
HC_CONTINUE = 0, // Plugin didn't take any action
@ -102,7 +105,9 @@ enum
// @note Warning: Be very careful, using this type of return will skip calls for all following AMXX plugins
};
// hookchain types
/**
* Hookchain argument types
*/
enum AType
{
ATYPE_INTEGER = 0,

View File

@ -4,14 +4,18 @@
#define _reapi_engine_const_included
// For native rh_get_mapname
/**
* For native rh_get_mapname
*/
enum MapNameType
{
MNT_TRUE, // return the original map name independant of the name set with via rh_set_mapname
MNT_SET // return the name of the current map
MNT_TRUE, // return the original map name independant of the name set with via rh_set_mapname
MNT_SET // return the name of the current map
};
// rh_emit_sound2 flags
/**
* rh_emit_sound2 flags
*/
#define SND_EMIT2_NOPAS BIT(0) // Never to check PAS
#define SND_EMIT2_INVOKER BIT(1) // Do not send to the client invoker

View File

@ -802,3 +802,21 @@ native rg_send_bartime2(const index, const duration, const startPercent, const b
* @noreturn
*/
native rg_send_audio(const index, const sample[], const pitch = PITCH_NORM);
/**
* Sets a parameter of the member CSPlayerItem::m_ItemInfo
*
* @param entity Entity index
* @param type Item info type. See ItemInfo constants.
*
*/
native rg_set_iteminfo(const entity, ItemInfo:type, any:...);
/**
* Gets a parameter of the member CSPlayerItem::m_ItemInfo
*
* @param entity Entity index
* @param type Item info type. See ItemInfo constants.
*
*/
native rg_get_iteminfo(const ent, ItemInfo:type, any:...);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class CBaseEntity;
class CCSEntity
{
public:
virtual ~CCSEntity() {}
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker);
virtual Vector FireBullets3(Vector &vecSrc, Vector &vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand);
public:
CBaseEntity *m_pContainingEntity;
};
class CCSDelay: public CCSEntity
{
public:
};
class CCSAnimating: public CCSDelay
{
public:
};
class CCSToggle: public CCSAnimating
{
public:
};
class CCSMonster: public CCSToggle
{
public:
};

View File

@ -28,90 +28,17 @@
#pragma once
class CBaseEntity;
class CBasePlayer;
#include <API/CSEntity.h>
#include <API/CSPlayer.h>
// Implementation wrapper
class CCSEntity {
public:
virtual ~CCSEntity() {}
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker);
virtual Vector FireBullets3(Vector &vecSrc, Vector &vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand);
public:
CBaseEntity *m_pContainingEntity;
};
class CCSDelay: public CCSEntity {};
class CCSAnimating: public CCSDelay {};
class CCSPlayerItem: public CCSAnimating {};
class CCSToggle: public CCSAnimating {};
class CCSMonster: public CCSToggle {};
class CCSWeaponBox: public CCSEntity {};
class CCSArmoury: public CCSEntity {};
class CCSPlayer: public CCSMonster {
public:
CCSPlayer() : m_bForceShowMenu(false), m_flRespawnPending(0)
{
m_szModel[0] = '\0';
}
virtual bool IsConnected() const;
virtual void SetAnimation(PLAYER_ANIM playerAnim);
virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
virtual CBaseEntity *GiveNamedItem(const char *pszName);
virtual CBaseEntity *GiveNamedItemEx(const char *pszName);
virtual void GiveDefaultItems();
virtual void GiveShield(bool bDeploy = true);
virtual void DropShield(bool bDeploy = true);
virtual void DropPlayerItem(const char *pszItemName);
virtual void RemoveShield();
virtual void RemoveAllItems(bool bRemoveSuit);
virtual bool RemovePlayerItem(const char* pszItemName);
virtual void SetPlayerModel(bool bHasC4);
virtual void SetPlayerModelEx(const char *modelName);
virtual void SetNewPlayerModel(const char *modelName);
virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr);
virtual void SetProgressBarTime(int time);
virtual void SetProgressBarTime2(int time, float timeElapsed);
virtual struct edict_s *EntSelectSpawnPoint();
virtual void SetBombIcon(bool bFlash = false);
virtual void SetScoreAttrib(CBasePlayer *dest);
virtual void SendItemStatus();
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
virtual void Observer_SetMode(int iMode);
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
virtual void SwitchTeam();
virtual bool JoinTeam(TeamName team);
virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle);
virtual void TeamChangeUpdate();
virtual void DropSecondary();
virtual void DropPrimary();
virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem);
virtual bool HasNamedPlayerItem(const char *pszItemName);
virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID);
virtual CBasePlayerItem *GetItemByName(const char *itemName);
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
virtual void ResetSequenceInfo();
virtual void StartDeathCam();
CBasePlayer *BasePlayer() const;
public:
char m_szModel[32];
bool m_bForceShowMenu;
float m_flRespawnPending;
};
class CAPI_Bot: public CCSPlayer {};
class CAPI_CSBot: public CAPI_Bot {};
class CCSShield: public CCSEntity {};
class CCSDeadHEV: public CCSMonster {};
class CCSSprayCan: public CCSEntity {};
class CCSBloodSplat: public CCSEntity {};
class CCSPlayerWeapon: public CCSPlayerItem {};
class CCSWorld: public CCSEntity {};
class CCSDecal: public CCSEntity {};
class CCSCorpse: public CCSEntity {};
@ -298,7 +225,5 @@ class CCSTriggerChangeTarget: public CCSDelay {};
class CCSTriggerCamera: public CCSDelay {};
class CCSWeather: public CCSTrigger {};
class CCSClientFog: public CCSEntity {};
inline CBasePlayer *CCSPlayer::BasePlayer() const {
return reinterpret_cast<CBasePlayer *>(this->m_pContainingEntity);
}
class CCSTriggerSetOrigin: public CCSDelay {};
class CCSItemAirBox: public CCSArmoury {};

View File

@ -0,0 +1,95 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
#include <API/CSPlayerItem.h>
#include <API/CSPlayerWeapon.h>
class CCSPlayer: public CCSMonster {
public:
CCSPlayer() : m_bForceShowMenu(false), m_flRespawnPending(0)
{
m_szModel[0] = '\0';
}
virtual bool IsConnected() const;
virtual void SetAnimation(PLAYER_ANIM playerAnim);
virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
virtual CBaseEntity *GiveNamedItem(const char *pszName);
virtual CBaseEntity *GiveNamedItemEx(const char *pszName);
virtual void GiveDefaultItems();
virtual void GiveShield(bool bDeploy = true);
virtual void DropShield(bool bDeploy = true);
virtual void DropPlayerItem(const char *pszItemName);
virtual void RemoveShield();
virtual void RemoveAllItems(bool bRemoveSuit);
virtual bool RemovePlayerItem(const char* pszItemName);
virtual void SetPlayerModel(bool bHasC4);
virtual void SetPlayerModelEx(const char *modelName);
virtual void SetNewPlayerModel(const char *modelName);
virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr);
virtual void SetProgressBarTime(int time);
virtual void SetProgressBarTime2(int time, float timeElapsed);
virtual struct edict_s *EntSelectSpawnPoint();
virtual void SetBombIcon(bool bFlash = false);
virtual void SetScoreAttrib(CBasePlayer *dest);
virtual void SendItemStatus();
virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
virtual void Observer_SetMode(int iMode);
virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
virtual bool SwitchWeapon(CBasePlayerItem *pWeapon);
virtual void SwitchTeam();
virtual bool JoinTeam(TeamName team);
virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle);
virtual void TeamChangeUpdate();
virtual void DropSecondary();
virtual void DropPrimary();
virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem);
virtual bool HasNamedPlayerItem(const char *pszItemName);
virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID);
virtual CBasePlayerItem *GetItemByName(const char *itemName);
virtual void Disappear();
virtual void MakeVIP();
virtual bool MakeBomber();
virtual void ResetSequenceInfo();
virtual void StartDeathCam();
CBasePlayer *BasePlayer() const;
public:
char m_szModel[32];
bool m_bForceShowMenu;
float m_flRespawnPending;
};
// Inlines
inline CBasePlayer *CCSPlayer::BasePlayer() const
{
return reinterpret_cast<CBasePlayer *>(this->m_pContainingEntity);
}

View File

@ -0,0 +1,52 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class CBasePlayerItem;
class CCSPlayerItem: public CCSAnimating
{
public:
CCSPlayerItem()
{
Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo));
}
virtual void SetItemInfo(ItemInfo *pInfo);
CBasePlayerItem *BasePlayerItem() const;
public:
ItemInfo m_ItemInfo;
};
// Inlines
inline CBasePlayerItem *CCSPlayerItem::BasePlayerItem() const
{
return reinterpret_cast<CBasePlayerItem *>(this->m_pContainingEntity);
}

View File

@ -0,0 +1,50 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
class CBasePlayerWeapon;
class CCSPlayerWeapon: public CCSPlayerItem
{
public:
CCSPlayerWeapon() :
m_bHasSecondaryAttack(false)
{
}
CBasePlayerWeapon *BasePlayerWeapon() const;
public:
bool m_bHasSecondaryAttack;
};
// Inlines
inline CBasePlayerWeapon *CCSPlayerWeapon::BasePlayerWeapon() const
{
return reinterpret_cast<CBasePlayerWeapon *>(this->m_pContainingEntity);
}

View File

@ -25,9 +25,11 @@
* version.
*
*/
#pragma once
#include "util.h"
#include "schedule.h"
#include "monsterevent.h"
class CSave;
@ -116,16 +118,24 @@ public:
void EXT_FUNC DLLEXPORT SUB_Blocked(CBaseEntity *pOther);
using thinkfn_t = decltype(m_pfnThink);
inline void SetThink(thinkfn_t pfn) { m_pfnThink = pfn; }
template <typename T>
void SetThink(void (T::*pfn)());
void SetThink(std::nullptr_t);
using touchfn_t = decltype(m_pfnTouch);
inline void SetTouch(touchfn_t pfn) { m_pfnTouch = pfn; }
template <typename T>
void SetTouch(void (T::*pfn)(CBaseEntity *pOther));
void SetTouch(std::nullptr_t);
using usefn_t = decltype(m_pfnUse);
inline void SetUse(usefn_t pfn) { m_pfnUse = pfn; }
template <typename T>
void SetUse(void (T::*pfn)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value));
void SetUse(std::nullptr_t);
using blockedfn_t = decltype(m_pfnBlocked);
inline void SetBlocked(blockedfn_t pfn) { m_pfnBlocked = pfn; }
template <typename T>
void SetBlocked(void (T::*pfn)(CBaseEntity *pOther));
void SetBlocked(std::nullptr_t);
virtual void Think() = 0;
virtual void Touch(CBaseEntity *pOther) = 0;
@ -189,6 +199,53 @@ public:
bool has_disconnected;
};
// Inlines
inline BOOL FNullEnt(CBaseEntity *ent) { return (ent == NULL || FNullEnt(ent->edict())); }
template <typename T>
inline void CBaseEntity::SetThink(void (T::*pfn)())
{
m_pfnThink = static_cast<thinkfn_t>(pfn);
}
inline void CBaseEntity::SetThink(std::nullptr_t)
{
m_pfnThink = nullptr;
}
template <typename T>
inline void CBaseEntity::SetTouch(void (T::*pfn)(CBaseEntity *pOther))
{
m_pfnTouch = static_cast<touchfn_t>(pfn);
}
inline void CBaseEntity::SetTouch(std::nullptr_t)
{
m_pfnTouch = nullptr;
}
template <typename T>
inline void CBaseEntity::SetUse(void (T::*pfn)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value))
{
m_pfnUse = static_cast<usefn_t>(pfn);
}
inline void CBaseEntity::SetUse(std::nullptr_t)
{
m_pfnUse = nullptr;
}
template <typename T>
inline void CBaseEntity::SetBlocked(void (T::*pfn)(CBaseEntity *pOther))
{
m_pfnBlocked = static_cast<blockedfn_t>(pfn);
}
inline void CBaseEntity::SetBlocked(std::nullptr_t)
{
m_pfnBlocked = nullptr;
}
class CPointEntity: public CBaseEntity {
public:
virtual void Spawn() = 0;
@ -266,25 +323,37 @@ public:
int m_cTriggersLeft; // trigger_counter only, # of activations remaining
float m_flHeight;
EHANDLE m_hActivator;
void (CBaseToggle::*m_pfnCallWhenMoveDone)();
using movedonefn_t = decltype(m_pfnCallWhenMoveDone);
inline void SetMoveDone(movedonefn_t pfn) { m_pfnCallWhenMoveDone = pfn; }
template <typename T>
void SetMoveDone(void (T::*pfn)());
void SetMoveDone(std::nullptr_t);
Vector m_vecFinalDest;
Vector m_vecFinalAngle;
int m_bitsDamageInflict; // DMG_ damage type that the door or tigger does
string_t m_sMaster; // If this button has a master switch, this is the targetname.
// A master switch must be of the multisource type. If all
// of the switches in the multisource have been triggered, then
// the button will be allowed to operate. Otherwise, it will be
// deactivated.
string_t m_sMaster; // If this button has a master switch, this is the targetname.
// A master switch must be of the multisource type. If all
// of the switches in the multisource have been triggered, then
// the button will be allowed to operate. Otherwise, it will be
// deactivated.
};
template <typename T>
inline void CBaseToggle::SetMoveDone(void (T::*pfn)())
{
m_pfnCallWhenMoveDone = static_cast<movedonefn_t>(pfn);
}
inline void CBaseToggle::SetMoveDone(std::nullptr_t)
{
m_pfnCallWhenMoveDone = nullptr;
}
#include "basemonster.h"
#include "weapons.h"
#include "player.h"
// Generic Button

View File

@ -25,13 +25,14 @@
* version.
*
*/
#pragma once
#include "../game_shared/GameEvent.h"
#include "../game_shared/bot/bot_util.h"
#include "../game_shared/bot/simple_state_machine.h"
#include "../game_shared/steam_util.h"
#include "../game_shared/perf_counter.h"
#include "../game_shared/counter.h"
#include "../game_shared/bot/bot_manager.h"
#include "../game_shared/bot/bot_constants.h"
#include "../game_shared/bot/bot.h"

View File

@ -25,6 +25,7 @@
* version.
*
*/
#pragma once
template<typename t_ret, typename ...t_args>

View File

@ -25,8 +25,10 @@
* version.
*
*/
#pragma once
#include "weapons.h"
#include "pm_materials.h"
#include "hintmessage.h"
#include "unisignals.h"

View File

@ -25,26 +25,28 @@
* version.
*
*/
#pragma once
#include "archtypes.h"
#include "regamedll_interfaces.h"
#include "hookchains.h"
#include "interface.h"
#include "player.h"
#include "gamerules.h"
#include "client.h"
#include "items.h"
#include <hookchains.h>
#include <interface.h>
#include <cbase.h>
#include <gamerules.h>
#include <client.h>
#include <API/CSInterfaces.h>
#define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 3
#define REGAMEDLL_API_VERSION_MINOR 4
// CBasePlayer::Spawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Spawn;
// CBasePlayer::Precache hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Precache;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Precache;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Precache;
// CBasePlayer::ObjectCaps hook
typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_ObjectCaps;
@ -55,8 +57,8 @@ typedef IHookChainClass<int, class CBasePlayer> IReGameHook_CBasePlayer_Classify
typedef IHookChainRegistryClass<int, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Classify;
// CBasePlayer::TraceAttack hook
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
typedef IHookChainClass<void, class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHook_CBasePlayer_TraceAttack;
typedef IHookChainRegistryClass<void, class CBasePlayer, struct entvars_s *, float, Vector &, struct TraceResult *, int> IReGameHookRegistry_CBasePlayer_TraceAttack;
// CBasePlayer::TakeDamage hook
typedef IHookChainClass<BOOL, class CBasePlayer, struct entvars_s *, struct entvars_s *, float&, int> IReGameHook_CBasePlayer_TakeDamage;
@ -67,16 +69,16 @@ typedef IHookChainClass<BOOL, class CBasePlayer, float, int> IReGameHook_CBasePl
typedef IHookChainRegistryClass<BOOL, class CBasePlayer, float, int> IReGameHookRegistry_CBasePlayer_TakeHealth;
// CBasePlayer::Killed hook
typedef IVoidHookChainClass<class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
typedef IVoidHookChainRegistryClass<class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
typedef IHookChainClass<void, class CBasePlayer, struct entvars_s *, int> IReGameHook_CBasePlayer_Killed;
typedef IHookChainRegistryClass<void, class CBasePlayer, struct entvars_s *, int> IReGameHookRegistry_CBasePlayer_Killed;
// CBasePlayer::AddPoints hook
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
typedef IHookChainClass<void, class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPoints;
typedef IHookChainRegistryClass<void, class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPoints;
// CBasePlayer::AddPointsToTeam hook
typedef IVoidHookChainClass<class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
typedef IHookChainClass<void, class CBasePlayer, int, BOOL> IReGameHook_CBasePlayer_AddPointsToTeam;
typedef IHookChainRegistryClass<void, class CBasePlayer, int, BOOL> IReGameHookRegistry_CBasePlayer_AddPointsToTeam;
// CBasePlayer::AddPlayerItem hook
typedef IHookChainClass<BOOL, class CBasePlayer, class CBasePlayerItem *> IReGameHook_CBasePlayer_AddPlayerItem;
@ -91,68 +93,68 @@ typedef IHookChainClass<int, class CBasePlayer, int , const char *, int> IReGame
typedef IHookChainRegistryClass<int, class CBasePlayer, int , const char *, int> IReGameHookRegistry_CBasePlayer_GiveAmmo;
// CBasePlayer::ResetMaxSpeed hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_ResetMaxSpeed;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ResetMaxSpeed;
// CBasePlayer::Jump hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Jump;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Jump;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Jump;
// CBasePlayer::Duck hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Duck;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Duck;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Duck;
// CBasePlayer::PreThink hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PreThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_PreThink;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_PreThink;
// CBasePlayer::PostThink hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_PostThink;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_PostThink;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_PostThink;
// CBasePlayer::UpdateClientData hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_UpdateClientData;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_UpdateClientData;
// CBasePlayer::ImpulseCommands hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_ImpulseCommands;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_ImpulseCommands;
// CBasePlayer::RoundRespawn hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_RoundRespawn;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_RoundRespawn;
// CBasePlayer::Blind hook
typedef IVoidHookChainClass<class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind;
typedef IVoidHookChainRegistryClass<class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
typedef IHookChainClass<void, class CBasePlayer, float, float, float, int> IReGameHook_CBasePlayer_Blind;
typedef IHookChainRegistryClass<void, class CBasePlayer, float, float, float, int> IReGameHookRegistry_CBasePlayer_Blind;
// CBasePlayer::Observer_IsValidTarget hook
typedef IHookChainClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHook_CBasePlayer_Observer_IsValidTarget;
typedef IHookChainRegistryClass<class CBasePlayer *, class CBasePlayer, int, bool> IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget;
// CBasePlayer::SetAnimation hook
typedef IVoidHookChainClass<class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IVoidHookChainRegistryClass<class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
typedef IHookChainClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHook_CBasePlayer_SetAnimation;
typedef IHookChainRegistryClass<void, class CBasePlayer, PLAYER_ANIM> IReGameHookRegistry_CBasePlayer_SetAnimation;
// CBasePlayer::GiveDefaultItems hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_GiveDefaultItems;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_GiveDefaultItems;
// CBasePlayer::GiveNamedItem hook
typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHook_CBasePlayer_GiveNamedItem;
typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_GiveNamedItem;
// CBasePlayer::AddAccount hook
typedef IVoidHookChainClass<class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
typedef IVoidHookChainRegistryClass<class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
typedef IHookChainClass<void, class CBasePlayer, int, RewardType, bool> IReGameHook_CBasePlayer_AddAccount;
typedef IHookChainRegistryClass<void, class CBasePlayer, int, RewardType, bool> IReGameHookRegistry_CBasePlayer_AddAccount;
// CBasePlayer::GiveShield hook
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
typedef IHookChainClass<void, class CBasePlayer, bool> IReGameHook_CBasePlayer_GiveShield;
typedef IHookChainRegistryClass<void, class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_GiveShield;
// CBasePlayer:SetClientUserInfoModel hook
typedef IVoidHookChainClass<class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
typedef IVoidHookChainRegistryClass<class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
typedef IHookChainClass<void, class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoModel;
typedef IHookChainRegistryClass<void, class CBasePlayer, char *, char *> IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel;
// CBasePlayer:SetClientUserInfoName hook
typedef IHookChainClass<bool, class CBasePlayer, char *, char *> IReGameHook_CBasePlayer_SetClientUserInfoName;
@ -163,56 +165,56 @@ typedef IHookChainClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHo
typedef IHookChainRegistryClass<bool, class CBasePlayer, ItemID, ItemRestType> IReGameHookRegistry_CBasePlayer_HasRestrictItem;
// CBasePlayer::DropPlayerItem hook
typedef IVoidHookChainClass<class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHook_CBasePlayer_DropPlayerItem;
typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, const char *> IReGameHookRegistry_CBasePlayer_DropPlayerItem;
// CBasePlayer::DropShield hook
typedef IVoidHookChainClass<class CBasePlayer, bool> IReGameHook_CBasePlayer_DropShield;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_DropShield;
typedef IHookChainClass<class CBaseEntity *, class CBasePlayer, bool> IReGameHook_CBasePlayer_DropShield;
typedef IHookChainRegistryClass<class CBaseEntity *, class CBasePlayer, bool> IReGameHookRegistry_CBasePlayer_DropShield;
// CBasePlayer::OnSpawnEquip hook
typedef IVoidHookChainClass<class CBasePlayer, bool, bool> IReGameHook_CBasePlayer_OnSpawnEquip;
typedef IVoidHookChainRegistryClass<class CBasePlayer, bool, bool> IReGameHookRegistry_CBasePlayer_OnSpawnEquip;
typedef IHookChainClass<void, class CBasePlayer, bool, bool> IReGameHook_CBasePlayer_OnSpawnEquip;
typedef IHookChainRegistryClass<void, class CBasePlayer, bool, bool> IReGameHookRegistry_CBasePlayer_OnSpawnEquip;
// CBasePlayer::Radio hook
typedef IVoidHookChainClass<class CBasePlayer, const char *, const char *, short, bool> IReGameHook_CBasePlayer_Radio;
typedef IVoidHookChainRegistryClass<class CBasePlayer, const char *, const char *, short, bool> IReGameHookRegistry_CBasePlayer_Radio;
typedef IHookChainClass<void, class CBasePlayer, const char *, const char *, short, bool> IReGameHook_CBasePlayer_Radio;
typedef IHookChainRegistryClass<void, class CBasePlayer, const char *, const char *, short, bool> IReGameHookRegistry_CBasePlayer_Radio;
// CBasePlayer::Disappear hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_Disappear;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_Disappear;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Disappear;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_Disappear;
// CBasePlayer::MakeVIP hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_MakeVIP;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeVIP;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_MakeVIP;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeVIP;
// CBasePlayer::MakeBomber hook
typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_MakeBomber;
typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_MakeBomber;
// CBasePlayer::StartObserver hook
typedef IVoidHookChainClass<class CBasePlayer, Vector &, Vector &> IReGameHook_CBasePlayer_StartObserver;
typedef IVoidHookChainRegistryClass<class CBasePlayer, Vector &, Vector &> IReGameHookRegistry_CBasePlayer_StartObserver;
typedef IHookChainClass<void, class CBasePlayer, Vector &, Vector &> IReGameHook_CBasePlayer_StartObserver;
typedef IHookChainRegistryClass<void, class CBasePlayer, Vector &, Vector &> IReGameHookRegistry_CBasePlayer_StartObserver;
// CBasePlayer::GetIntoGame hook
typedef IHookChainClass<bool, class CBasePlayer> IReGameHook_CBasePlayer_GetIntoGame;
typedef IHookChainRegistryClass<bool, class CBasePlayer> IReGameHookRegistry_CBasePlayer_GetIntoGame;
// CBaseAnimating::ResetSequenceInfo hook
typedef IVoidHookChainClass<class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IVoidHookChainRegistryClass<class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
typedef IHookChainClass<void, class CBaseAnimating> IReGameHook_CBaseAnimating_ResetSequenceInfo;
typedef IHookChainRegistryClass<void, class CBaseAnimating> IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo;
// GetForceCamera hook
typedef IHookChain<int, class CBasePlayer *> IReGameHook_GetForceCamera;
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_GetForceCamera;
// PlayerBlind hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHook_PlayerBlind;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHookRegistry_PlayerBlind;
typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHook_PlayerBlind;
typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, float, float, int, Vector &> IReGameHookRegistry_PlayerBlind;
// RadiusFlash_TraceLine hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, struct TraceResult *> IReGameHook_RadiusFlash_TraceLine;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, struct TraceResult *> IReGameHookRegistry_RadiusFlash_TraceLine;
typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, struct TraceResult *> IReGameHook_RadiusFlash_TraceLine;
typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *, Vector &, Vector &, struct TraceResult *> IReGameHookRegistry_RadiusFlash_TraceLine;
// RoundEnd hook
typedef IHookChain<bool, int, ScenarioEventEndRound, float> IReGameHook_RoundEnd;
@ -223,32 +225,32 @@ typedef IHookChain<class CGameRules *> IReGameHook_InstallGameRules;
typedef IHookChainRegistry<class CGameRules *> IReGameHookRegistry_InstallGameRules;
// PM_Init hook
typedef IVoidHookChain<struct playermove_s *> IReGameHook_PM_Init;
typedef IVoidHookChainRegistry<struct playermove_s *> IReGameHookRegistry_PM_Init;
typedef IHookChain<void, struct playermove_s *> IReGameHook_PM_Init;
typedef IHookChainRegistry<void, struct playermove_s *> IReGameHookRegistry_PM_Init;
// PM_Move hook
typedef IVoidHookChain<struct playermove_s *, int> IReGameHook_PM_Move;
typedef IVoidHookChainRegistry<struct playermove_s *, int> IReGameHookRegistry_PM_Move;
typedef IHookChain<void, struct playermove_s *, int> IReGameHook_PM_Move;
typedef IHookChainRegistry<void, struct playermove_s *, int> IReGameHookRegistry_PM_Move;
// PM_AirMove hook
typedef IVoidHookChain<int> IReGameHook_PM_AirMove;
typedef IVoidHookChainRegistry<int> IReGameHookRegistry_PM_AirMove;
typedef IHookChain<void, int> IReGameHook_PM_AirMove;
typedef IHookChainRegistry<void, int> IReGameHookRegistry_PM_AirMove;
// HandleMenu_ChooseAppearance hook
typedef IVoidHookChain<class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseAppearance;
typedef IVoidHookChainRegistry<class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseAppearance;
typedef IHookChain<void, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseAppearance;
typedef IHookChainRegistry<void, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseAppearance;
// HandleMenu_ChooseTeam hook
typedef IHookChain<BOOL, class CBasePlayer *, int> IReGameHook_HandleMenu_ChooseTeam;
typedef IHookChainRegistry<BOOL, class CBasePlayer *, int> IReGameHookRegistry_HandleMenu_ChooseTeam;
// ShowMenu hook
typedef IVoidHookChain<class CBasePlayer *, int, int, BOOL, char *> IReGameHook_ShowMenu;
typedef IVoidHookChainRegistry<class CBasePlayer *, int, int, BOOL, char *> IReGameHookRegistry_ShowMenu;
typedef IHookChain<void, class CBasePlayer *, int, int, BOOL, char *> IReGameHook_ShowMenu;
typedef IHookChainRegistry<void, class CBasePlayer *, int, int, BOOL, char *> IReGameHookRegistry_ShowMenu;
// ShowVGUIMenu hook
typedef IVoidHookChain<class CBasePlayer *, int, int, char *> IReGameHook_ShowVGUIMenu;
typedef IVoidHookChainRegistry<class CBasePlayer *, int, int, char *> IReGameHookRegistry_ShowVGUIMenu;
typedef IHookChain<void, class CBasePlayer *, int, int, char *> IReGameHook_ShowVGUIMenu;
typedef IHookChainRegistry<void, class CBasePlayer *, int, int, char *> IReGameHookRegistry_ShowVGUIMenu;
// BuyGunAmmo hook
typedef IHookChain<bool, class CBasePlayer *, class CBasePlayerItem *, bool> IReGameHook_BuyGunAmmo;
@ -259,8 +261,8 @@ typedef IHookChain<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGa
typedef IHookChainRegistry<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGameHookRegistry_BuyWeaponByWeaponID;
// InternalCommand hook
typedef IHookChain<bool, edict_t *, const char *> IReGameHook_InternalCommand;
typedef IHookChainRegistry<bool, edict_t *, const char *> IReGameHookRegistry_InternalCommand;
typedef IHookChain<void, edict_t *, const char *, const char *> IReGameHook_InternalCommand;
typedef IHookChainRegistry<void, edict_t *, const char *, const char *> IReGameHookRegistry_InternalCommand;
// CHalfLifeMultiplay::FShouldSwitchWeapon hook
typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_FShouldSwitchWeapon;
@ -279,8 +281,8 @@ typedef IHookChain<BOOL, class CBasePlayer *, CBaseEntity *> IReGameHook_CSGameR
typedef IHookChainRegistry<BOOL, class CBasePlayer *, CBaseEntity *> IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage;
// CHalfLifeMultiplay::PlayerSpawn hook
typedef IVoidHookChain<class CBasePlayer *> IReGameHook_CSGameRules_PlayerSpawn;
typedef IVoidHookChainRegistry<class CBasePlayer *> IReGameHookRegistry_CSGameRules_PlayerSpawn;
typedef IHookChain<void, class CBasePlayer *> IReGameHook_CSGameRules_PlayerSpawn;
typedef IHookChainRegistry<void, class CBasePlayer *> IReGameHookRegistry_CSGameRules_PlayerSpawn;
// CHalfLifeMultiplay::FPlayerCanRespawn hook
typedef IHookChain<BOOL, class CBasePlayer *> IReGameHook_CSGameRules_FPlayerCanRespawn;
@ -291,16 +293,16 @@ typedef IHookChain<struct edict_s *, class CBasePlayer *> IReGameHook_CSGameRule
typedef IHookChainRegistry<struct edict_s *, class CBasePlayer *> IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot;
// CHalfLifeMultiplay::ClientUserInfoChanged hook
typedef IVoidHookChain<class CBasePlayer *, char *> IReGameHook_CSGameRules_ClientUserInfoChanged;
typedef IVoidHookChainRegistry<class CBasePlayer *, char *> IReGameHookRegistry_CSGameRules_ClientUserInfoChanged;
typedef IHookChain<void, class CBasePlayer *, char *> IReGameHook_CSGameRules_ClientUserInfoChanged;
typedef IHookChainRegistry<void, class CBasePlayer *, char *> IReGameHookRegistry_CSGameRules_ClientUserInfoChanged;
// CHalfLifeMultiplay::PlayerKilled hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_PlayerKilled;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_PlayerKilled;
typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_PlayerKilled;
typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_PlayerKilled;
// CHalfLifeMultiplay::DeathNotice hook
typedef IVoidHookChain<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_DeathNotice;
typedef IVoidHookChainRegistry<class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_DeathNotice;
typedef IHookChain<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHook_CSGameRules_DeathNotice;
typedef IHookChainRegistry<void, class CBasePlayer *, struct entvars_s *, struct entvars_s *> IReGameHookRegistry_CSGameRules_DeathNotice;
// CHalfLifeMultiplay::CanHavePlayerItem hook
typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_CanHavePlayerItem;
@ -311,147 +313,147 @@ typedef IHookChain<int, class CBasePlayer *> IReGameHook_CSGameRules_DeadPlayerW
typedef IHookChainRegistry<int, class CBasePlayer *> IReGameHookRegistry_CSGameRules_DeadPlayerWeapons;
// CHalfLifeMultiplay::ServerDeactivate hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_ServerDeactivate;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ServerDeactivate;
typedef IHookChain<void> IReGameHook_CSGameRules_ServerDeactivate;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_ServerDeactivate;
// CHalfLifeMultiplay::CheckMapConditions hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckMapConditions;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckMapConditions;
typedef IHookChain<void> IReGameHook_CSGameRules_CheckMapConditions;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CheckMapConditions;
// CHalfLifeMultiplay::CleanUpMap hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CleanUpMap;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CleanUpMap;
typedef IHookChain<void> IReGameHook_CSGameRules_CleanUpMap;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CleanUpMap;
// CHalfLifeMultiplay::RestartRound hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_RestartRound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RestartRound;
typedef IHookChain<void> IReGameHook_CSGameRules_RestartRound;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_RestartRound;
// CHalfLifeMultiplay::CheckWinConditions hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckWinConditions;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckWinConditions;
typedef IHookChain<void> IReGameHook_CSGameRules_CheckWinConditions;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_CheckWinConditions;
// CHalfLifeMultiplay::RemoveGuns hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_RemoveGuns;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RemoveGuns;
typedef IHookChain<void> IReGameHook_CSGameRules_RemoveGuns;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_RemoveGuns;
// CHalfLifeMultiplay::GiveC4 hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_GiveC4;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GiveC4;
typedef IHookChain<void> IReGameHook_CSGameRules_GiveC4;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_GiveC4;
// CHalfLifeMultiplay::ChangeLevel hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_ChangeLevel;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ChangeLevel;
typedef IHookChain<void> IReGameHook_CSGameRules_ChangeLevel;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_ChangeLevel;
// CHalfLifeMultiplay::GoToIntermission hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_GoToIntermission;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermission;
typedef IHookChain<void> IReGameHook_CSGameRules_GoToIntermission;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_GoToIntermission;
// CHalfLifeMultiplay::BalanceTeams hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams;
typedef IHookChain<void> IReGameHook_CSGameRules_BalanceTeams;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_BalanceTeams;
// CHalfLifeMultiplay::OnRoundFreezeEnd hook
typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd;
typedef IHookChain<void> IReGameHook_CSGameRules_OnRoundFreezeEnd;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd;
// PM_UpdateStepSound hook
typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound;
typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound;
typedef IHookChain<void> IReGameHook_PM_UpdateStepSound;
typedef IHookChainRegistry<void> IReGameHookRegistry_PM_UpdateStepSound;
// CBasePlayer::StartDeathCam hook
typedef IVoidHookChainClass<class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IVoidHookChainRegistryClass<class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_StartDeathCam;
typedef IHookChainRegistryClass<void, class CBasePlayer> IReGameHookRegistry_CBasePlayer_StartDeathCam;
class IReGameHookchains {
public:
virtual ~IReGameHookchains() {}
// CBasePlayer virtual
virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn() = 0;
virtual IReGameHookRegistry_CBasePlayer_Precache* CBasePlayer_Precache() = 0;
virtual IReGameHookRegistry_CBasePlayer_ObjectCaps* CBasePlayer_ObjectCaps() = 0;
virtual IReGameHookRegistry_CBasePlayer_Classify* CBasePlayer_Classify() = 0;
virtual IReGameHookRegistry_CBasePlayer_TraceAttack* CBasePlayer_TraceAttack() = 0;
virtual IReGameHookRegistry_CBasePlayer_TakeDamage* CBasePlayer_TakeDamage() = 0;
virtual IReGameHookRegistry_CBasePlayer_TakeHealth* CBasePlayer_TakeHealth() = 0;
virtual IReGameHookRegistry_CBasePlayer_Killed* CBasePlayer_Killed() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPoints* CBasePlayer_AddPoints() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPointsToTeam* CBasePlayer_AddPointsToTeam() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPlayerItem* CBasePlayer_AddPlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_RemovePlayerItem* CBasePlayer_RemovePlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveAmmo* CBasePlayer_GiveAmmo() = 0;
virtual IReGameHookRegistry_CBasePlayer_ResetMaxSpeed* CBasePlayer_ResetMaxSpeed() = 0;
virtual IReGameHookRegistry_CBasePlayer_Jump* CBasePlayer_Jump() = 0;
virtual IReGameHookRegistry_CBasePlayer_Duck* CBasePlayer_Duck() = 0;
virtual IReGameHookRegistry_CBasePlayer_PreThink* CBasePlayer_PreThink() = 0;
virtual IReGameHookRegistry_CBasePlayer_PostThink* CBasePlayer_PostThink() = 0;
virtual IReGameHookRegistry_CBasePlayer_UpdateClientData* CBasePlayer_UpdateClientData() = 0;
virtual IReGameHookRegistry_CBasePlayer_ImpulseCommands* CBasePlayer_ImpulseCommands() = 0;
virtual IReGameHookRegistry_CBasePlayer_RoundRespawn* CBasePlayer_RoundRespawn() = 0;
virtual IReGameHookRegistry_CBasePlayer_Blind* CBasePlayer_Blind() = 0;
virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn() = 0;
virtual IReGameHookRegistry_CBasePlayer_Precache *CBasePlayer_Precache() = 0;
virtual IReGameHookRegistry_CBasePlayer_ObjectCaps *CBasePlayer_ObjectCaps() = 0;
virtual IReGameHookRegistry_CBasePlayer_Classify *CBasePlayer_Classify() = 0;
virtual IReGameHookRegistry_CBasePlayer_TraceAttack *CBasePlayer_TraceAttack() = 0;
virtual IReGameHookRegistry_CBasePlayer_TakeDamage *CBasePlayer_TakeDamage() = 0;
virtual IReGameHookRegistry_CBasePlayer_TakeHealth *CBasePlayer_TakeHealth() = 0;
virtual IReGameHookRegistry_CBasePlayer_Killed *CBasePlayer_Killed() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPoints *CBasePlayer_AddPoints() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPointsToTeam *CBasePlayer_AddPointsToTeam() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddPlayerItem *CBasePlayer_AddPlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_RemovePlayerItem *CBasePlayer_RemovePlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveAmmo *CBasePlayer_GiveAmmo() = 0;
virtual IReGameHookRegistry_CBasePlayer_ResetMaxSpeed *CBasePlayer_ResetMaxSpeed() = 0;
virtual IReGameHookRegistry_CBasePlayer_Jump *CBasePlayer_Jump() = 0;
virtual IReGameHookRegistry_CBasePlayer_Duck *CBasePlayer_Duck() = 0;
virtual IReGameHookRegistry_CBasePlayer_PreThink *CBasePlayer_PreThink() = 0;
virtual IReGameHookRegistry_CBasePlayer_PostThink *CBasePlayer_PostThink() = 0;
virtual IReGameHookRegistry_CBasePlayer_UpdateClientData *CBasePlayer_UpdateClientData() = 0;
virtual IReGameHookRegistry_CBasePlayer_ImpulseCommands *CBasePlayer_ImpulseCommands() = 0;
virtual IReGameHookRegistry_CBasePlayer_RoundRespawn *CBasePlayer_RoundRespawn() = 0;
virtual IReGameHookRegistry_CBasePlayer_Blind *CBasePlayer_Blind() = 0;
virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget* CBasePlayer_Observer_IsValidTarget() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetAnimation* CBasePlayer_SetAnimation() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems* CBasePlayer_GiveDefaultItems() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem* CBasePlayer_GiveNamedItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0;
virtual IReGameHookRegistry_CBasePlayer_HasRestrictItem* CBasePlayer_HasRestrictItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropShield* CBasePlayer_DropShield() = 0;
virtual IReGameHookRegistry_CBasePlayer_OnSpawnEquip* CBasePlayer_OnSpawnEquip() = 0;
virtual IReGameHookRegistry_CBasePlayer_Radio* CBasePlayer_Radio() = 0;
virtual IReGameHookRegistry_CBasePlayer_Disappear* CBasePlayer_Disappear() = 0;
virtual IReGameHookRegistry_CBasePlayer_MakeVIP* CBasePlayer_MakeVIP() = 0;
virtual IReGameHookRegistry_CBasePlayer_MakeBomber* CBasePlayer_MakeBomber() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartObserver* CBasePlayer_StartObserver() = 0;
virtual IReGameHookRegistry_CBasePlayer_GetIntoGame* CBasePlayer_GetIntoGame() = 0;
virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget *CBasePlayer_Observer_IsValidTarget() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetAnimation *CBasePlayer_SetAnimation() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems *CBasePlayer_GiveDefaultItems() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem *CBasePlayer_GiveNamedItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_AddAccount *CBasePlayer_AddAccount() = 0;
virtual IReGameHookRegistry_CBasePlayer_GiveShield *CBasePlayer_GiveShield() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel *CBasePlayer_SetClientUserInfoModel() = 0;
virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName *CBasePlayer_SetClientUserInfoName() = 0;
virtual IReGameHookRegistry_CBasePlayer_HasRestrictItem *CBasePlayer_HasRestrictItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem *CBasePlayer_DropPlayerItem() = 0;
virtual IReGameHookRegistry_CBasePlayer_DropShield *CBasePlayer_DropShield() = 0;
virtual IReGameHookRegistry_CBasePlayer_OnSpawnEquip *CBasePlayer_OnSpawnEquip() = 0;
virtual IReGameHookRegistry_CBasePlayer_Radio *CBasePlayer_Radio() = 0;
virtual IReGameHookRegistry_CBasePlayer_Disappear *CBasePlayer_Disappear() = 0;
virtual IReGameHookRegistry_CBasePlayer_MakeVIP *CBasePlayer_MakeVIP() = 0;
virtual IReGameHookRegistry_CBasePlayer_MakeBomber *CBasePlayer_MakeBomber() = 0;
virtual IReGameHookRegistry_CBasePlayer_StartObserver *CBasePlayer_StartObserver() = 0;
virtual IReGameHookRegistry_CBasePlayer_GetIntoGame *CBasePlayer_GetIntoGame() = 0;
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0;
virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo *CBaseAnimating_ResetSequenceInfo() = 0;
virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0;
virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0;
virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0;
virtual IReGameHookRegistry_RoundEnd* RoundEnd() = 0;
virtual IReGameHookRegistry_InstallGameRules* InstallGameRules() = 0;
virtual IReGameHookRegistry_PM_Init* PM_Init() = 0;
virtual IReGameHookRegistry_PM_Move* PM_Move() = 0;
virtual IReGameHookRegistry_PM_AirMove* PM_AirMove() = 0;
virtual IReGameHookRegistry_HandleMenu_ChooseAppearance* HandleMenu_ChooseAppearance() = 0;
virtual IReGameHookRegistry_HandleMenu_ChooseTeam* HandleMenu_ChooseTeam() = 0;
virtual IReGameHookRegistry_ShowMenu* ShowMenu() = 0;
virtual IReGameHookRegistry_ShowVGUIMenu* ShowVGUIMenu() = 0;
virtual IReGameHookRegistry_BuyGunAmmo* BuyGunAmmo() = 0;
virtual IReGameHookRegistry_BuyWeaponByWeaponID* BuyWeaponByWeaponID() = 0;
virtual IReGameHookRegistry_InternalCommand* InternalCommand() = 0;
virtual IReGameHookRegistry_GetForceCamera *GetForceCamera() = 0;
virtual IReGameHookRegistry_PlayerBlind *PlayerBlind() = 0;
virtual IReGameHookRegistry_RadiusFlash_TraceLine *RadiusFlash_TraceLine() = 0;
virtual IReGameHookRegistry_RoundEnd *RoundEnd() = 0;
virtual IReGameHookRegistry_InstallGameRules *InstallGameRules() = 0;
virtual IReGameHookRegistry_PM_Init *PM_Init() = 0;
virtual IReGameHookRegistry_PM_Move *PM_Move() = 0;
virtual IReGameHookRegistry_PM_AirMove *PM_AirMove() = 0;
virtual IReGameHookRegistry_HandleMenu_ChooseAppearance *HandleMenu_ChooseAppearance() = 0;
virtual IReGameHookRegistry_HandleMenu_ChooseTeam *HandleMenu_ChooseTeam() = 0;
virtual IReGameHookRegistry_ShowMenu *ShowMenu() = 0;
virtual IReGameHookRegistry_ShowVGUIMenu *ShowVGUIMenu() = 0;
virtual IReGameHookRegistry_BuyGunAmmo *BuyGunAmmo() = 0;
virtual IReGameHookRegistry_BuyWeaponByWeaponID *BuyWeaponByWeaponID() = 0;
virtual IReGameHookRegistry_InternalCommand *InternalCommand() = 0;
virtual IReGameHookRegistry_CSGameRules_FShouldSwitchWeapon* CSGameRules_FShouldSwitchWeapon() = 0;
virtual IReGameHookRegistry_CSGameRules_GetNextBestWeapon* CSGameRules_GetNextBestWeapon() = 0;
virtual IReGameHookRegistry_CSGameRules_FlPlayerFallDamage* CSGameRules_FlPlayerFallDamage() = 0;
virtual IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage* CSGameRules_FPlayerCanTakeDamage() = 0;
virtual IReGameHookRegistry_CSGameRules_PlayerSpawn* CSGameRules_PlayerSpawn() = 0;
virtual IReGameHookRegistry_CSGameRules_FPlayerCanRespawn* CSGameRules_FPlayerCanRespawn() = 0;
virtual IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot* CSGameRules_GetPlayerSpawnSpot() = 0;
virtual IReGameHookRegistry_CSGameRules_ClientUserInfoChanged* CSGameRules_ClientUserInfoChanged() = 0;
virtual IReGameHookRegistry_CSGameRules_PlayerKilled* CSGameRules_PlayerKilled() = 0;
virtual IReGameHookRegistry_CSGameRules_DeathNotice* CSGameRules_DeathNotice() = 0;
virtual IReGameHookRegistry_CSGameRules_CanHavePlayerItem* CSGameRules_CanHavePlayerItem() = 0;
virtual IReGameHookRegistry_CSGameRules_DeadPlayerWeapons* CSGameRules_DeadPlayerWeapons() = 0;
virtual IReGameHookRegistry_CSGameRules_ServerDeactivate* CSGameRules_ServerDeactivate() = 0;
virtual IReGameHookRegistry_CSGameRules_CheckMapConditions* CSGameRules_CheckMapConditions() = 0;
virtual IReGameHookRegistry_CSGameRules_CleanUpMap* CSGameRules_CleanUpMap() = 0;
virtual IReGameHookRegistry_CSGameRules_RestartRound* CSGameRules_RestartRound() = 0;
virtual IReGameHookRegistry_CSGameRules_CheckWinConditions* CSGameRules_CheckWinConditions() = 0;
virtual IReGameHookRegistry_CSGameRules_RemoveGuns* CSGameRules_RemoveGuns() = 0;
virtual IReGameHookRegistry_CSGameRules_GiveC4* CSGameRules_GiveC4() = 0;
virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0;
virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0;
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;
virtual IReGameHookRegistry_CSGameRules_FShouldSwitchWeapon *CSGameRules_FShouldSwitchWeapon() = 0;
virtual IReGameHookRegistry_CSGameRules_GetNextBestWeapon *CSGameRules_GetNextBestWeapon() = 0;
virtual IReGameHookRegistry_CSGameRules_FlPlayerFallDamage *CSGameRules_FlPlayerFallDamage() = 0;
virtual IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage *CSGameRules_FPlayerCanTakeDamage() = 0;
virtual IReGameHookRegistry_CSGameRules_PlayerSpawn *CSGameRules_PlayerSpawn() = 0;
virtual IReGameHookRegistry_CSGameRules_FPlayerCanRespawn *CSGameRules_FPlayerCanRespawn() = 0;
virtual IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot *CSGameRules_GetPlayerSpawnSpot() = 0;
virtual IReGameHookRegistry_CSGameRules_ClientUserInfoChanged *CSGameRules_ClientUserInfoChanged() = 0;
virtual IReGameHookRegistry_CSGameRules_PlayerKilled *CSGameRules_PlayerKilled() = 0;
virtual IReGameHookRegistry_CSGameRules_DeathNotice *CSGameRules_DeathNotice() = 0;
virtual IReGameHookRegistry_CSGameRules_CanHavePlayerItem *CSGameRules_CanHavePlayerItem() = 0;
virtual IReGameHookRegistry_CSGameRules_DeadPlayerWeapons *CSGameRules_DeadPlayerWeapons() = 0;
virtual IReGameHookRegistry_CSGameRules_ServerDeactivate *CSGameRules_ServerDeactivate() = 0;
virtual IReGameHookRegistry_CSGameRules_CheckMapConditions *CSGameRules_CheckMapConditions() = 0;
virtual IReGameHookRegistry_CSGameRules_CleanUpMap *CSGameRules_CleanUpMap() = 0;
virtual IReGameHookRegistry_CSGameRules_RestartRound *CSGameRules_RestartRound() = 0;
virtual IReGameHookRegistry_CSGameRules_CheckWinConditions *CSGameRules_CheckWinConditions() = 0;
virtual IReGameHookRegistry_CSGameRules_RemoveGuns *CSGameRules_RemoveGuns() = 0;
virtual IReGameHookRegistry_CSGameRules_GiveC4 *CSGameRules_GiveC4() = 0;
virtual IReGameHookRegistry_CSGameRules_ChangeLevel *CSGameRules_ChangeLevel() = 0;
virtual IReGameHookRegistry_CSGameRules_GoToIntermission *CSGameRules_GoToIntermission() = 0;
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 {
@ -474,17 +476,19 @@ public:
virtual int GetMajorVersion() = 0;
virtual int GetMinorVersion() = 0;
virtual const ReGameFuncs_t* GetFuncs() = 0;
virtual IReGameHookchains* GetHookchains() = 0;
virtual const ReGameFuncs_t *GetFuncs() = 0;
virtual IReGameHookchains *GetHookchains() = 0;
virtual class CGameRules* GetGameRules() = 0;
virtual struct WeaponInfoStruct* GetWeaponInfo(int weaponID) = 0;
virtual struct WeaponInfoStruct* GetWeaponInfo(const char* weaponName) = 0;
virtual struct playermove_s* GetPlayerMove() = 0;
virtual struct WeaponSlotInfo* GetWeaponSlot(WeaponIdType weaponID) = 0;
virtual struct WeaponSlotInfo* GetWeaponSlot(const char* weaponName) = 0;
virtual struct ItemInfo* GetItemInfo(WeaponIdType weaponID) = 0;
virtual struct AmmoInfo* GetAmmoInfo(AmmoType ammoID) = 0;
virtual class CGameRules *GetGameRules() = 0;
virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0;
virtual struct WeaponInfoStruct *GetWeaponInfo(const char *weaponName) = 0;
virtual struct playermove_s *GetPlayerMove() = 0;
virtual struct WeaponSlotInfo *GetWeaponSlot(WeaponIdType weaponID) = 0;
virtual struct WeaponSlotInfo *GetWeaponSlot(const char *weaponName) = 0;
virtual struct ItemInfo *GetItemInfo(WeaponIdType weaponID) = 0;
virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0;
};
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"

View File

@ -25,80 +25,84 @@
* version.
*
*/
#pragma once
// These are caps bits to indicate what an object's capabilities (currently used for save/restore and level transitions)
#define FCAP_CUSTOMSAVE 0x00000001
#define FCAP_ACROSS_TRANSITION 0x00000002 // should transfer between transitions
#define FCAP_MUST_SPAWN 0x00000004 // Spawn after restore
#define FCAP_DONT_SAVE 0x80000000 // Don't save this
#define FCAP_IMPULSE_USE 0x00000008 // can be used by the player
#define FCAP_CONTINUOUS_USE 0x00000010 // can be used by the player
#define FCAP_ONOFF_USE 0x00000020 // can be used by the player
#define FCAP_DIRECTIONAL_USE 0x00000040 // Player sends +/- 1 when using (currently only tracktrains)
#define FCAP_MASTER 0x00000080 // Can be used to "master" other entities (like multisource)
#define FCAP_CUSTOMSAVE 0x00000001
#define FCAP_ACROSS_TRANSITION 0x00000002 // Should transfer between transitions
#define FCAP_MUST_SPAWN 0x00000004 // Spawn after restore
#define FCAP_DONT_SAVE 0x80000000 // Don't save this
#define FCAP_IMPULSE_USE 0x00000008 // Can be used by the player
#define FCAP_CONTINUOUS_USE 0x00000010 // Can be used by the player
#define FCAP_ONOFF_USE 0x00000020 // Can be used by the player
#define FCAP_DIRECTIONAL_USE 0x00000040 // Player sends +/- 1 when using (currently only tracktrains)
#define FCAP_MASTER 0x00000080 // Can be used to "master" other entities (like multisource)
#define FCAP_MUST_RESET 0x00000100 // Should reset on the new round
#define FCAP_MUST_RELEASE 0x00000200 // Should release on the new round
// UNDONE: This will ignore transition volumes (trigger_transition), but not the PVS!!!
#define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions
#define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions
// for Classify
#define CLASS_NONE 0
#define CLASS_MACHINE 1
#define CLASS_PLAYER 2
#define CLASS_HUMAN_PASSIVE 3
#define CLASS_HUMAN_MILITARY 4
#define CLASS_ALIEN_MILITARY 5
#define CLASS_ALIEN_PASSIVE 6
#define CLASS_ALIEN_MONSTER 7
#define CLASS_ALIEN_PREY 8
#define CLASS_ALIEN_PREDATOR 9
#define CLASS_INSECT 10
#define CLASS_PLAYER_ALLY 11
#define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players
#define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace
#define CLASS_VEHICLE 14
#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures.
#define CLASS_NONE 0
#define CLASS_MACHINE 1
#define CLASS_PLAYER 2
#define CLASS_HUMAN_PASSIVE 3
#define CLASS_HUMAN_MILITARY 4
#define CLASS_ALIEN_MILITARY 5
#define CLASS_ALIEN_PASSIVE 6
#define CLASS_ALIEN_MONSTER 7
#define CLASS_ALIEN_PREY 8
#define CLASS_ALIEN_PREDATOR 9
#define CLASS_INSECT 10
#define CLASS_PLAYER_ALLY 11
#define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players
#define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace
#define CLASS_VEHICLE 14
#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures.
#define SF_NORESPAWN (1 << 30) // set this bit on guns and stuff that should never respawn.
#define SF_NORESPAWN (1<<30) // set this bit on guns and stuff that should never respawn.
#define DMG_GENERIC 0 // generic damage was done
#define DMG_CRUSH (1<<0) // crushed by falling or moving object
#define DMG_BULLET (1<<1) // shot
#define DMG_SLASH (1<<2) // cut, clawed, stabbed
#define DMG_BURN (1<<3) // heat burned
#define DMG_FREEZE (1<<4) // frozen
#define DMG_FALL (1<<5) // fell too far
#define DMG_BLAST (1<<6) // explosive blast damage
#define DMG_CLUB (1<<7) // crowbar, punch, headbutt
#define DMG_SHOCK (1<<8) // electric shock
#define DMG_SONIC (1<<9) // sound pulse shockwave
#define DMG_ENERGYBEAM (1<<10) // laser or other high energy beam
#define DMG_NEVERGIB (1<<12) // with this bit OR'd in, no damage type will be able to gib victims upon death
#define DMG_ALWAYSGIB (1<<13) // with this bit OR'd in, any damage type can be made to gib victims upon death
#define DMG_DROWN (1<<14) // Drowning
#define DMG_GENERIC 0 // generic damage was done
#define DMG_CRUSH (1<<0) // crushed by falling or moving object
#define DMG_BULLET (1<<1) // shot
#define DMG_SLASH (1<<2) // cut, clawed, stabbed
#define DMG_BURN (1<<3) // heat burned
#define DMG_FREEZE (1<<4) // frozen
#define DMG_FALL (1<<5) // fell too far
#define DMG_BLAST (1<<6) // explosive blast damage
#define DMG_CLUB (1<<7) // crowbar, punch, headbutt
#define DMG_SHOCK (1<<8) // electric shock
#define DMG_SONIC (1<<9) // sound pulse shockwave
#define DMG_ENERGYBEAM (1<<10) // laser or other high energy beam
#define DMG_NEVERGIB (1<<12) // with this bit OR'd in, no damage type will be able to gib victims upon death
#define DMG_ALWAYSGIB (1<<13) // with this bit OR'd in, any damage type can be made to gib victims upon death
#define DMG_DROWN (1<<14) // Drowning
// time-based damage
#define DMG_TIMEBASED (~(0x3FFF)) // mask for time-based damage
#define DMG_TIMEBASED (~(0x3FFF)) // mask for time-based damage
#define DMG_PARALYZE (1<<15) // slows affected creature down
#define DMG_NERVEGAS (1<<16) // nerve toxins, very bad
#define DMG_POISON (1<<17) // blood poisioning
#define DMG_RADIATION (1<<18) // radiation exposure
#define DMG_DROWNRECOVER (1<<19) // drowning recovery
#define DMG_ACID (1<<20) // toxic chemicals or acid burns
#define DMG_SLOWBURN (1<<21) // in an oven
#define DMG_SLOWFREEZE (1<<22) // in a subzero freezer
#define DMG_MORTAR (1<<23) // Hit by air raid (done to distinguish grenade from mortar)
#define DMG_EXPLOSION (1<<24)
#define DMG_PARALYZE (1<<15) // slows affected creature down
#define DMG_NERVEGAS (1<<16) // nerve toxins, very bad
#define DMG_POISON (1<<17) // blood poisioning
#define DMG_RADIATION (1<<18) // radiation exposure
#define DMG_DROWNRECOVER (1<<19) // drowning recovery
#define DMG_ACID (1<<20) // toxic chemicals or acid burns
#define DMG_SLOWBURN (1<<21) // in an oven
#define DMG_SLOWFREEZE (1<<22) // in a subzero freezer
#define DMG_MORTAR (1<<23) // Hit by air raid (done to distinguish grenade from mortar)
#define DMG_EXPLOSION (1<<24)
// these are the damage types that are allowed to gib corpses
#define DMG_GIB_CORPSE (DMG_CRUSH | DMG_FALL | DMG_BLAST | DMG_SONIC | DMG_CLUB)
// These are the damage types that are allowed to gib corpses
#define DMG_GIB_CORPSE (DMG_CRUSH | DMG_FALL | DMG_BLAST | DMG_SONIC | DMG_CLUB)
// these are the damage types that have client hud art
#define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK)
// These are the damage types that have client hud art
#define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK)
// when calling KILLED(), a value that governs gib behavior is expected to be
// When calling KILLED(), a value that governs gib behavior is expected to be
// one of these three values
#define GIB_NORMAL 0 // gib if entity was overkilled
#define GIB_NEVER 1 // never gib, no matter how much death damage is done ( freezing, etc )
#define GIB_ALWAYS 2 // always gib ( Houndeye Shock, Barnacle Bite )
#define GIB_NORMAL 0 // Gib if entity was overkilled
#define GIB_NEVER 1 // Never gib, no matter how much death damage is done ( freezing, etc )
#define GIB_ALWAYS 2 // Always gib ( Houndeye Shock, Barnacle Bite )
#define GIB_HEALTH_VALUE -30

View File

@ -0,0 +1,207 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
#define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\
int derivedClass::Save(CSave &save)\
{\
if (!baseClass::Save(save))\
return 0;\
return save.WriteFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\
}\
int derivedClass::Restore(CRestore &restore)\
{\
if (!baseClass::Restore(restore))\
return 0;\
return restore.ReadFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\
}
enum GLOBALESTATE
{
GLOBAL_OFF,
GLOBAL_ON,
GLOBAL_DEAD
};
typedef struct globalentity_s
{
char name[64];
char levelName[MAX_MAPNAME_LENGHT];
GLOBALESTATE state;
struct globalentity_s *pNext;
} globalentity_t;
struct HEADER
{
unsigned short size;
unsigned short token;
char *pData;
};
const int MAX_ENTITY_ARRAY = 64;
class CBaseEntity;
class CSaveRestoreBuffer
{
public:
CSaveRestoreBuffer();
CSaveRestoreBuffer(SAVERESTOREDATA *pdata);
~CSaveRestoreBuffer();
int EntityIndex(entvars_t *pevLookup);
int EntityIndex(edict_t *pentLookup);
int EntityIndex(EOFFSET eoLookup);
int EntityIndex(CBaseEntity *pEntity);
int EntityFlags(int entityIndex, int flags);
int EntityFlagsSet(int entityIndex, int flags);
edict_t *EntityFromIndex(int entityIndex);
unsigned short TokenHash(const char *pszToken);
protected:
static constexpr int m_Sizes[] = {
sizeof(float), // FIELD_FLOAT
sizeof(int), // FIELD_STRING
sizeof(int), // FIELD_ENTITY
sizeof(int), // FIELD_CLASSPTR
sizeof(int), // FIELD_EHANDLE
sizeof(int), // FIELD_entvars_t
sizeof(int), // FIELD_EDICT
sizeof(float) * 3, // FIELD_VECTOR
sizeof(float) * 3, // FIELD_POSITION_VECTOR
sizeof(int *), // FIELD_POINTER
sizeof(int), // FIELD_INTEGER
sizeof(int *), // FIELD_FUNCTION
sizeof(int), // FIELD_BOOLEAN
sizeof(short), // FIELD_SHORT
sizeof(char), // FIELD_CHARACTER
sizeof(float), // FIELD_TIME
sizeof(int), // FIELD_MODELNAME
sizeof(int), // FIELD_SOUNDNAME
};
SAVERESTOREDATA *m_pData;
void BufferRewind(int size);
unsigned int HashString(const char *pszToken);
};
class CSave: public CSaveRestoreBuffer
{
public:
CSave(SAVERESTOREDATA *pdata) : CSaveRestoreBuffer(pdata) {};
void WriteShort(const char *pname, const short *value, int count);
void WriteInt(const char *pname, const int *value, int count);
void WriteFloat(const char *pname, const float *value, int count);
void WriteTime(const char *pname, const float *value, int count);
void WriteData(const char *pname, int size, const char *pdata);
void WriteString(const char *pname, const char *pstring);
void WriteString(const char *pname, const int *stringId, int count);
void WriteVector(const char *pname, const Vector &value);
void WriteVector(const char *pname, const float *value, int count);
void WritePositionVector(const char *pname, const Vector &value);
void WritePositionVector(const char *pname, const float *value, int count);
void WriteFunction(const char *pname, void **data, int count);
int WriteEntVars(const char *pname, entvars_t *pev);
int WriteFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
private:
int DataEmpty(const char *pdata, int size);
void BufferField(const char *pname, int size, const char *pdata);
void BufferString(char *pdata, int len);
void BufferData(const char *pdata, int size);
void BufferHeader(const char *pname, int size);
};
class CRestore: public CSaveRestoreBuffer
{
public:
CRestore(SAVERESTOREDATA *pdata) : CSaveRestoreBuffer(pdata)
{
m_global = FALSE;
m_precache = TRUE;
}
int ReadEntVars(const char *pname, entvars_t *pev);
int ReadFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
int ReadField(void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount, int startField, int size, char *pName, void *pData);
int ReadInt();
short ReadShort();
int ReadNamedInt(const char *pName);
char *ReadNamedString(const char *pName);
bool Empty() const { return (!m_pData || ((m_pData->pCurrentData - m_pData->pBaseData) >= m_pData->bufferSize)); }
void SetGlobalMode(BOOL global) { m_global = global; }
void PrecacheMode(BOOL mode) { m_precache = mode; }
private:
char *BufferPointer();
void BufferReadBytes(char *pOutput, int size);
void BufferSkipBytes(int bytes);
int BufferSkipZString();
int BufferCheckZString(const char *string);
void BufferReadHeader(HEADER *pheader);
private:
BOOL m_global;
BOOL m_precache;
};
class CGlobalState
{
public:
CGlobalState();
void Reset();
void ClearStates();
void EntityAdd(string_t globalname, string_t mapName, GLOBALESTATE state);
void EntitySetState(string_t globalname, GLOBALESTATE state);
void EntityUpdate(string_t globalname, string_t mapname);
const globalentity_t *EntityFromTable(string_t globalname);
GLOBALESTATE EntityGetState(string_t globalname);
BOOL EntityInTable(string_t globalname) { return Find(globalname) ? TRUE : FALSE; }
int Save(CSave &save);
int Restore(CRestore &restore);
void DumpGlobals();
static TYPEDESCRIPTION m_SaveData[];
static TYPEDESCRIPTION m_GlobalEntitySaveData[];
private:
globalentity_t *Find(string_t globalname);
globalentity_t *m_pList;
int m_listCount;
};
void SaveGlobalState(SAVERESTOREDATA *pSaveData);
void RestoreGlobalState(SAVERESTOREDATA *pSaveData);
void ResetGlobalState();
extern CGlobalState gGlobalState;

View File

@ -0,0 +1,289 @@
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#pragma once
// these MoveFlag values are assigned to a WayPoint's TYPE in order to demonstrate the
// type of movement the monster should use to get there.
#define bits_MF_TO_TARGETENT BIT(0) // local move to targetent.
#define bits_MF_TO_ENEMY BIT(1) // local move to enemy
#define bits_MF_TO_COVER BIT(2) // local move to a hiding place
#define bits_MF_TO_DETOUR BIT(3) // local move to detour point.
#define bits_MF_TO_PATHCORNER BIT(4) // local move to a path corner
#define bits_MF_TO_NODE BIT(5) // local move to a node
#define bits_MF_TO_LOCATION BIT(6) // local move to an arbitrary point
#define bits_MF_IS_GOAL BIT(7) // this waypoint is the goal of the whole move.
#define bits_MF_DONT_SIMPLIFY BIT(8) // Don't let the route code simplify this waypoint
// If you define any flags that aren't _TO_ flags, add them here so we can mask
// them off when doing compares.
#define bits_MF_NOT_TO_MASK (bits_MF_IS_GOAL | bits_MF_DONT_SIMPLIFY)
#define MOVEGOAL_NONE (0)
#define MOVEGOAL_TARGETENT (bits_MF_TO_TARGETENT)
#define MOVEGOAL_ENEMY (bits_MF_TO_ENEMY)
#define MOVEGOAL_PATHCORNER (bits_MF_TO_PATHCORNER)
#define MOVEGOAL_LOCATION (bits_MF_TO_LOCATION)
#define MOVEGOAL_NODE (bits_MF_TO_NODE)
// these bits represent conditions that may befall the monster, of which some are allowed
// to interrupt certain schedules.
#define bits_COND_NO_AMMO_LOADED BIT(0) // weapon needs to be reloaded!
#define bits_COND_SEE_HATE BIT(1) // see something that you hate
#define bits_COND_SEE_FEAR BIT(2) // see something that you are afraid of
#define bits_COND_SEE_DISLIKE BIT(3) // see something that you dislike
#define bits_COND_SEE_ENEMY BIT(4) // target entity is in full view.
#define bits_COND_ENEMY_OCCLUDED BIT(5) // target entity occluded by the world
#define bits_COND_SMELL_FOOD BIT(6)
#define bits_COND_ENEMY_TOOFAR BIT(7)
#define bits_COND_LIGHT_DAMAGE BIT(8) // hurt a little
#define bits_COND_HEAVY_DAMAGE BIT(9) // hurt a lot
#define bits_COND_CAN_RANGE_ATTACK1 BIT(10)
#define bits_COND_CAN_MELEE_ATTACK1 BIT(11)
#define bits_COND_CAN_RANGE_ATTACK2 BIT(12)
#define bits_COND_CAN_MELEE_ATTACK2 BIT(13)
//#define bits_COND_CAN_RANGE_ATTACK3 BIT(14)
#define bits_COND_PROVOKED BIT(15)
#define bits_COND_NEW_ENEMY BIT(16)
#define bits_COND_HEAR_SOUND BIT(17) // there is an interesting sound
#define bits_COND_SMELL BIT(18) // there is an interesting scent
#define bits_COND_ENEMY_FACING_ME BIT(19) // enemy is facing me
#define bits_COND_ENEMY_DEAD BIT(20) // enemy was killed. If you get this in combat, try to find another enemy. If you get it in alert, victory dance.
#define bits_COND_SEE_CLIENT BIT(21) // see a client
#define bits_COND_SEE_NEMESIS BIT(22) // see my nemesis
#define bits_COND_SPECIAL1 BIT(28) // Defined by individual monster
#define bits_COND_SPECIAL2 BIT(29) // Defined by individual monster
#define bits_COND_TASK_FAILED BIT(30)
#define bits_COND_SCHEDULE_DONE BIT(31)
#define bits_COND_ALL_SPECIAL (bits_COND_SPECIAL1 | bits_COND_SPECIAL2)
#define bits_COND_CAN_ATTACK (bits_COND_CAN_RANGE_ATTACK1 | bits_COND_CAN_MELEE_ATTACK1 | bits_COND_CAN_RANGE_ATTACK2 | bits_COND_CAN_MELEE_ATTACK2)
#define TASKSTATUS_NEW 0 // Just started
#define TASKSTATUS_RUNNING 1 // Running task & movement
#define TASKSTATUS_RUNNING_MOVEMENT 2 // Just running movement
#define TASKSTATUS_RUNNING_TASK 3 // Just running task
#define TASKSTATUS_COMPLETE 4 // Completed, get next task
// These are the schedule types
typedef enum
{
SCHED_NONE = 0,
SCHED_IDLE_STAND,
SCHED_IDLE_WALK,
SCHED_WAKE_ANGRY,
SCHED_WAKE_CALLED,
SCHED_ALERT_FACE,
SCHED_ALERT_SMALL_FLINCH,
SCHED_ALERT_BIG_FLINCH,
SCHED_ALERT_STAND,
SCHED_INVESTIGATE_SOUND,
SCHED_COMBAT_FACE,
SCHED_COMBAT_STAND,
SCHED_CHASE_ENEMY,
SCHED_CHASE_ENEMY_FAILED,
SCHED_VICTORY_DANCE,
SCHED_TARGET_FACE,
SCHED_TARGET_CHASE,
SCHED_SMALL_FLINCH,
SCHED_TAKE_COVER_FROM_ENEMY,
SCHED_TAKE_COVER_FROM_BEST_SOUND,
SCHED_TAKE_COVER_FROM_ORIGIN,
SCHED_COWER, // usually a last resort!
SCHED_MELEE_ATTACK1,
SCHED_MELEE_ATTACK2,
SCHED_RANGE_ATTACK1,
SCHED_RANGE_ATTACK2,
SCHED_SPECIAL_ATTACK1,
SCHED_SPECIAL_ATTACK2,
SCHED_STANDOFF,
SCHED_ARM_WEAPON,
SCHED_RELOAD,
SCHED_GUARD,
SCHED_AMBUSH,
SCHED_DIE,
SCHED_WAIT_TRIGGER,
SCHED_FOLLOW,
SCHED_SLEEP,
SCHED_WAKE,
SCHED_BARNACLE_VICTIM_GRAB,
SCHED_BARNACLE_VICTIM_CHOMP,
SCHED_AISCRIPT,
SCHED_FAIL,
LAST_COMMON_SCHEDULE // Leave this at the bottom
} SCHEDULE_TYPE;
// These are the shared tasks
typedef enum
{
TASK_INVALID = 0,
TASK_WAIT,
TASK_WAIT_FACE_ENEMY,
TASK_WAIT_PVS,
TASK_SUGGEST_STATE,
TASK_WALK_TO_TARGET,
TASK_RUN_TO_TARGET,
TASK_MOVE_TO_TARGET_RANGE,
TASK_GET_PATH_TO_ENEMY,
TASK_GET_PATH_TO_ENEMY_LKP,
TASK_GET_PATH_TO_ENEMY_CORPSE,
TASK_GET_PATH_TO_LEADER,
TASK_GET_PATH_TO_SPOT,
TASK_GET_PATH_TO_TARGET,
TASK_GET_PATH_TO_HINTNODE,
TASK_GET_PATH_TO_LASTPOSITION,
TASK_GET_PATH_TO_BESTSOUND,
TASK_GET_PATH_TO_BESTSCENT,
TASK_RUN_PATH,
TASK_WALK_PATH,
TASK_STRAFE_PATH,
TASK_CLEAR_MOVE_WAIT,
TASK_STORE_LASTPOSITION,
TASK_CLEAR_LASTPOSITION,
TASK_PLAY_ACTIVE_IDLE,
TASK_FIND_HINTNODE,
TASK_CLEAR_HINTNODE,
TASK_SMALL_FLINCH,
TASK_FACE_IDEAL,
TASK_FACE_ROUTE,
TASK_FACE_ENEMY,
TASK_FACE_HINTNODE,
TASK_FACE_TARGET,
TASK_FACE_LASTPOSITION,
TASK_RANGE_ATTACK1,
TASK_RANGE_ATTACK2,
TASK_MELEE_ATTACK1,
TASK_MELEE_ATTACK2,
TASK_RELOAD,
TASK_RANGE_ATTACK1_NOTURN,
TASK_RANGE_ATTACK2_NOTURN,
TASK_MELEE_ATTACK1_NOTURN,
TASK_MELEE_ATTACK2_NOTURN,
TASK_RELOAD_NOTURN,
TASK_SPECIAL_ATTACK1,
TASK_SPECIAL_ATTACK2,
TASK_CROUCH,
TASK_STAND,
TASK_GUARD,
TASK_STEP_LEFT,
TASK_STEP_RIGHT,
TASK_STEP_FORWARD,
TASK_STEP_BACK,
TASK_DODGE_LEFT,
TASK_DODGE_RIGHT,
TASK_SOUND_ANGRY,
TASK_SOUND_DEATH,
TASK_SET_ACTIVITY,
TASK_SET_SCHEDULE,
TASK_SET_FAIL_SCHEDULE,
TASK_CLEAR_FAIL_SCHEDULE,
TASK_PLAY_SEQUENCE,
TASK_PLAY_SEQUENCE_FACE_ENEMY,
TASK_PLAY_SEQUENCE_FACE_TARGET,
TASK_SOUND_IDLE,
TASK_SOUND_WAKE,
TASK_SOUND_PAIN,
TASK_SOUND_DIE,
TASK_FIND_COVER_FROM_BEST_SOUND, // tries lateral cover first, then node cover
TASK_FIND_COVER_FROM_ENEMY, // tries lateral cover first, then node cover
TASK_FIND_LATERAL_COVER_FROM_ENEMY,
TASK_FIND_NODE_COVER_FROM_ENEMY,
TASK_FIND_NEAR_NODE_COVER_FROM_ENEMY, // data for this one is the MAXIMUM acceptable distance to the cover.
TASK_FIND_FAR_NODE_COVER_FROM_ENEMY, // data for this one is there MINIMUM aceptable distance to the cover.
TASK_FIND_COVER_FROM_ORIGIN,
TASK_EAT,
TASK_DIE,
TASK_WAIT_FOR_SCRIPT,
TASK_PLAY_SCRIPT,
TASK_ENABLE_SCRIPT,
TASK_PLANT_ON_SCRIPT,
TASK_FACE_SCRIPT,
TASK_WAIT_RANDOM,
TASK_WAIT_INDEFINITE,
TASK_STOP_MOVING,
TASK_TURN_LEFT,
TASK_TURN_RIGHT,
TASK_REMEMBER,
TASK_FORGET,
TASK_WAIT_FOR_MOVEMENT, // wait until MovementIsComplete()
LAST_COMMON_TASK, // LEAVE THIS AT THE BOTTOM (sjb)
} SHARED_TASKS;
// These go in the flData member of the TASK_WALK_TO_TARGET, TASK_RUN_TO_TARGET
enum
{
TARGET_MOVE_NORMAL = 0,
TARGET_MOVE_SCRIPTED = 1,
};
// A goal should be used for a task that requires several schedules to complete.
// The goal index should indicate which schedule (ordinally) the monster is running.
// That way, when tasks fail, the AI can make decisions based on the context of the
// current goal and sequence rather than just the current schedule.
enum
{
GOAL_ATTACK_ENEMY,
GOAL_MOVE,
GOAL_TAKE_COVER,
GOAL_MOVE_TARGET,
GOAL_EAT,
};
// an array of tasks is a task list
// an array of schedules is a schedule list
struct Task_t
{
int iTask;
float flData;
};
struct Schedule_t
{
Task_t *pTasklist;
int cTasks;
int iInterruptMask; // a bit mask of conditions that can interrupt this schedule
// a more specific mask that indicates which TYPES of sounds will interrupt the schedule in the
// event that the schedule is broken by COND_HEAR_SOUND
int iSoundMask;
const char *pName;
};
// an array of waypoints makes up the monster's route.
// LATER - this declaration doesn't belong in this file.
struct WayPoint_t
{
Vector vecLocation;
int iType;
};

View File

@ -28,8 +28,6 @@
#pragma once
#include "weapontype.h"
class CBasePlayer;
#define MAX_WEAPONS 32
@ -134,6 +132,9 @@ struct MULTIDAMAGE
int type;
};
#include "weapontype.h"
#include "items.h"
class CArmoury: public CBaseEntity {
public:
virtual void Spawn() = 0;
@ -186,6 +187,7 @@ public:
};
// Items that the player has in their inventory that they can use
class CCSPlayerItem;
class CBasePlayerItem: public CBaseAnimating {
public:
virtual int Save(CSave &save) = 0;
@ -213,6 +215,12 @@ public:
virtual CBasePlayerItem *GetWeaponPtr() = 0;
virtual float GetMaxSpeed() = 0;
virtual int iItemSlot() = 0; // return 0 to MAX_ITEMS_SLOTS, used in hud
CCSPlayerItem *CSPlayerItem() const
{
return reinterpret_cast<CCSPlayerItem *>(this->m_pEntity);
}
public:
CBasePlayer *m_pPlayer;
CBasePlayerItem *m_pNext;
@ -220,6 +228,7 @@ public:
};
// inventory items that
class CCSPlayerWeapon;
class CBasePlayerWeapon: public CBasePlayerItem {
public:
virtual int Save(CSave &save) = 0;
@ -251,6 +260,12 @@ public:
virtual void RetireWeapon() = 0;
virtual BOOL ShouldWeaponIdle() = 0;
virtual BOOL UseDecrement() = 0;
CCSPlayerWeapon *CSPlayerWeapon() const
{
return reinterpret_cast<CCSPlayerWeapon *>(this->m_pEntity);
}
public:
BOOL IsPistol() { return (m_iId == WEAPON_USP || m_iId == WEAPON_GLOCK18 || m_iId == WEAPON_P228 || m_iId == WEAPON_DEAGLE || m_iId == WEAPON_ELITE || m_iId == WEAPON_FIVESEVEN); }

View File

@ -340,7 +340,7 @@ enum InventorySlotType
GRENADE_SLOT,
C4_SLOT,
};
enum Bullet
{
BULLET_NONE,
@ -406,7 +406,10 @@ struct WeaponInfoStruct
int maxRounds;
int ammoType;
char *entityName;
const char *ammoName;
// custom
const char *ammoName1;
const char *ammoName2;
};
struct WeaponSlotInfo

View File

@ -378,24 +378,24 @@ bool CBasePlayer_HasRestrictItem(IReGameHook_CBasePlayer_HasRestrictItem *chain,
return callForward<bool>(RG_CBasePlayer_HasRestrictItem, original, indexOfEdict(pthis->pev), item, type);
}
void CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName)
CBaseEntity *CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName)
{
auto original = [chain](int _pthis, const char *_pszItemName)
{
chain->callNext(getPrivate<CBasePlayer>(_pthis), _pszItemName);
return indexOfPDataAmx(chain->callNext(getPrivate<CBasePlayer>(_pthis), _pszItemName));
};
callVoidForward(RG_CBasePlayer_DropPlayerItem, original, indexOfEdict(pthis->pev), pszItemName);
return getPrivate<CBaseEntity>(callForward<size_t>(RG_CBasePlayer_DropPlayerItem, original, indexOfEdict(pthis->pev), pszItemName));
}
void CBasePlayer_DropShield(IReGameHook_CBasePlayer_DropShield *chain, CBasePlayer *pthis, bool bDeploy)
CBaseEntity *CBasePlayer_DropShield(IReGameHook_CBasePlayer_DropShield *chain, CBasePlayer *pthis, bool bDeploy)
{
auto original = [chain](int _pthis, bool _bDeploy)
{
chain->callNext(getPrivate<CBasePlayer>(_pthis), _bDeploy);
return indexOfPDataAmx(chain->callNext(getPrivate<CBasePlayer>(_pthis), _bDeploy));
};
callVoidForward(RG_CBasePlayer_DropShield, original, indexOfEdict(pthis->pev), bDeploy);
return getPrivate<CBaseEntity>(callForward<size_t>(RG_CBasePlayer_DropShield, original, indexOfEdict(pthis->pev), bDeploy));
}
void CBasePlayer_OnSpawnEquip(IReGameHook_CBasePlayer_OnSpawnEquip *chain, CBasePlayer *pthis, bool addDefault, bool equipGame)

View File

@ -360,8 +360,8 @@ void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlay
void CBasePlayer_SetClientUserInfoModel(IReGameHook_CBasePlayer_SetClientUserInfoModel *chain, CBasePlayer *pthis, char *infobuffer, char *szNewModel);
bool CBasePlayer_SetClientUserInfoName(IReGameHook_CBasePlayer_SetClientUserInfoName *chain, CBasePlayer *pthis, char *infobuffer, char *szNewName);
bool CBasePlayer_HasRestrictItem(IReGameHook_CBasePlayer_HasRestrictItem *chain, CBasePlayer *pthis, ItemID item, ItemRestType type);
void CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName);
void CBasePlayer_DropShield(IReGameHook_CBasePlayer_DropShield *chain, CBasePlayer *pthis, bool bDeploy);
CBaseEntity *CBasePlayer_DropPlayerItem(IReGameHook_CBasePlayer_DropPlayerItem *chain, CBasePlayer *pthis, const char *pszItemName);
CBaseEntity *CBasePlayer_DropShield(IReGameHook_CBasePlayer_DropShield *chain, CBasePlayer *pthis, bool bDeploy);
void CBasePlayer_OnSpawnEquip(IReGameHook_CBasePlayer_OnSpawnEquip *chain, CBasePlayer *pthis, bool addDefault, bool equipGame);
void CBasePlayer_Radio(IReGameHook_CBasePlayer_Radio *chain, CBasePlayer *pthis, const char *msg_id, const char *msg_verbose, short pitch, bool showIcon);
void CBasePlayer_Disappear(IReGameHook_CBasePlayer_Disappear *chain, CBasePlayer *pthis);

View File

@ -62,6 +62,7 @@
#define SHIELD_MEMBERS(mx) CLASS_MEMBERS(CWShield, mx, m_Shield_##mx, m_)
#define REBUYSTRUCT_MEMBERS(mx) CLASS_MEMBERS(RebuyStruct, mx, mx,)
#define MAPINFO_MEMBERS(mx) CLASS_MEMBERS(CMapInfo, mx, m_MapInfo_##mx, m_)
#define CSPLWPN_MEMBERS(mx) CLASS_MEMBERS(CCSPlayerWeapon, mx, m_Weapon_##mx, m_)
inline MType getMemberType(float*) { return MEMBER_FLOAT; }
inline MType getMemberType(float) { return MEMBER_FLOAT; }
@ -988,6 +989,10 @@ member_t memberlist_mapinfo[] = {
MAPINFO_MEMBERS(flBombRadius),
};
member_t memberlist_csplayerweapon[] = {
CSPLWPN_MEMBERS(bHasSecondaryAttack)
};
memberlist_t memberlist;
member_t *memberlist_t::operator[](size_t members) const
@ -1045,6 +1050,7 @@ member_t *memberlist_t::operator[](size_t members) const
CASE(shield)
CASE(rebuystruct)
CASE(mapinfo)
CASE(csplayerweapon)
}
return nullptr;

View File

@ -80,12 +80,12 @@ struct memberlist_t
mt_shield,
mt_rebuystruct,
mt_mapinfo,
mt_csplayerweapon,
};
};
struct member_t
{
bool hasTable(size_t members, memberlist_t::members_tables_e tbl) const;
bool isTypeReturnable() const;
size_t size;
@ -95,15 +95,6 @@ struct member_t
MType type;
};
inline bool member_t::hasTable(size_t members, memberlist_t::members_tables_e tbl) const
{
const auto table = memberlist_t::members_tables_e(members / MAX_REGION_RANGE);
if (likely(table != tbl))
return false;
return true;
}
inline bool member_t::isTypeReturnable() const
{
switch (type) {
@ -1041,3 +1032,8 @@ enum MapInfo_Members
m_MapInfo_iBuyingStatus = BEGIN_MEMBER_REGION(mapinfo),
m_MapInfo_flBombRadius,
};
enum CSPlayerWeapon_Members
{
m_Weapon_bHasSecondaryAttack = BEGIN_MEMBER_REGION(csplayerweapon),
};

View File

@ -28,16 +28,12 @@ cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params)
cell* value = getAmxAddr(amx, params[arg_value]);
size_t element = (PARAMS_COUNT == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0;
if (member->hasTable(params[arg_member], memberlist_t::mt_csplayer)) {
CBasePlayer *pPlayer = (CBasePlayer *)pEdict->pvPrivateData;
if (unlikely(pPlayer->CSPlayer() == nullptr)) {
return FALSE;
}
return set_member(pPlayer->CSPlayer(), member, value, element);
}
return set_member(pEdict->pvPrivateData, member, value, element);
return set_member(
get_pdata_custom(getPrivate<CBaseEntity>(pEdict), params[arg_member]),
member,
value,
element
);
}
/*
@ -103,16 +99,13 @@ cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params)
break;
}
if (member->hasTable(params[arg_member], memberlist_t::mt_csplayer)) {
CBasePlayer *pPlayer = (CBasePlayer *)pEdict->pvPrivateData;
if (unlikely(pPlayer->CSPlayer() == nullptr)) {
return FALSE;
}
return get_member(pPlayer->CSPlayer(), member, dest, element, length);
}
return get_member(pEdict->pvPrivateData, member, dest, element, length);
return get_member(
get_pdata_custom(getPrivate<CBaseEntity>(pEdict), params[arg_member]),
member,
dest,
element,
length
);
}
/*
@ -620,8 +613,11 @@ void RegisterNatives_Members()
cell set_member(void* pdata, const member_t *member, cell* value, size_t element)
{
char string[2048];
if (!pdata) {
return FALSE;
}
char string[2048];
switch (member->type) {
case MEMBER_CLASSPTR:
{
@ -744,6 +740,10 @@ cell set_member(void* pdata, const member_t *member, cell* value, size_t element
cell get_member(void* pdata, const member_t *member, cell* dest, size_t element, size_t length)
{
if (!pdata) {
return 0;
}
switch (member->type)
{
case MEMBER_CLASSPTR:
@ -866,3 +866,22 @@ cell get_member(void* pdata, const member_t *member, cell* dest, size_t element,
return 0;
}
void *get_pdata_custom(CBaseEntity *pEntity, cell member)
{
const auto table = memberlist_t::members_tables_e(member / MAX_REGION_RANGE);
switch (table) {
case memberlist_t::mt_csplayer:
case memberlist_t::mt_csplayerweapon: {
if (unlikely(pEntity->m_pEntity == nullptr)) {
return nullptr;
}
return pEntity->m_pEntity;
}
default:
break;
}
return pEntity;
}

View File

@ -2,6 +2,7 @@
void RegisterNatives_Members();
void *get_pdata_custom(CBaseEntity *pEntity, cell member);
cell set_member(void* pdata, const member_t *member, cell* value, size_t element);
cell get_member(void* pdata, const member_t *member, cell* dest, size_t element, size_t length = 0);

View File

@ -739,12 +739,12 @@ cell AMX_NATIVE_CALL rg_get_weapon_info(AMX *amx, cell *params)
cell* dest = getAmxAddr(amx, params[arg_3]);
size_t length = *getAmxAddr(amx, params[arg_4]);
if (info->ammoName == nullptr) {
if (info->ammoName1 == nullptr) {
setAmxString(dest, "", 1);
return 0;
}
setAmxString(dest, info->ammoName, length);
setAmxString(dest, info->ammoName1, length);
return 1;
}
case WI_NAME:
@ -766,6 +766,7 @@ cell AMX_NATIVE_CALL rg_get_weapon_info(AMX *amx, cell *params)
setAmxString(dest, info->entityName, length);
return 1;
}
default:
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: unknown type statement %i, params count %i", __FUNCTION__, info_type, PARAMS_COUNT);
return -1;
@ -1924,6 +1925,166 @@ cell AMX_NATIVE_CALL rg_send_audio(AMX *amx, cell *params)
return TRUE;
}
enum ItemInfo_e
{
ItemInfo_iSlot,
ItemInfo_iPosition,
ItemInfo_pszAmmo1,
ItemInfo_iMaxAmmo1,
ItemInfo_pszAmmo2,
ItemInfo_iMaxAmmo2,
ItemInfo_pszName,
ItemInfo_iMaxClip,
ItemInfo_iId,
ItemInfo_iFlags,
ItemInfo_iWeight
};
/**
* Sets a parameter of the member CSPlayerItem::m_ItemInfo
*
* @param entity Entity index
* @param type Item info type. See ItemInfo constants.
*
* native rg_set_iteminfo(const entity, ItemInfo:type, any:...);
*/
cell AMX_NATIVE_CALL rg_set_iteminfo(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_type, arg_value };
CHECK_ISENTITY(arg_index);
CBasePlayerWeapon *pWeapon = getPrivate<CBasePlayerWeapon>(params[arg_index]);
if (unlikely(pWeapon == nullptr)) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: invalid or uninitialized entity", __FUNCTION__);
return FALSE;
}
if (pWeapon->IsWeapon()) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: #%d entity is not a weapon.", __FUNCTION__, indexOfEdict(pWeapon->pev));
return FALSE;
}
CCSPlayerItem *pItem = pWeapon->CSPlayerItem();
if (unlikely(pItem == nullptr)) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: invalid or uninitialized m_pEntity.", __FUNCTION__);
return FALSE;
}
char itembuf[256];
cell *ptr = getAmxAddr(amx, params[arg_value]);
ItemInfo_e type = static_cast<ItemInfo_e>(params[arg_type]);
switch (type)
{
case ItemInfo_iSlot: pItem->m_ItemInfo.iSlot = *ptr; break;
case ItemInfo_iPosition: pItem->m_ItemInfo.iPosition = *ptr; break;
case ItemInfo_iMaxAmmo1: pItem->m_ItemInfo.iMaxAmmo1 = *ptr; break;
case ItemInfo_iMaxAmmo2: pItem->m_ItemInfo.iMaxAmmo2 = *ptr; break;
case ItemInfo_iMaxClip: pItem->m_ItemInfo.iMaxClip = *ptr; break;
case ItemInfo_iId: pItem->m_ItemInfo.iId = *ptr; break;
case ItemInfo_iFlags: pItem->m_ItemInfo.iFlags = *ptr; break;
case ItemInfo_iWeight: pItem->m_ItemInfo.iWeight = *ptr; break;
case ItemInfo_pszAmmo1: pItem->m_ItemInfo.pszAmmo1 = getAmxString(amx, params[arg_value], itembuf); break;
case ItemInfo_pszAmmo2: pItem->m_ItemInfo.pszAmmo2 = getAmxString(amx, params[arg_value], itembuf); break;
case ItemInfo_pszName: pItem->m_ItemInfo.pszName = getAmxString(amx, params[arg_value], itembuf); break;
default:
AMXX_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", type);
return FALSE;
}
return TRUE;
}
/**
* Gets a parameter of the member CSPlayerItem::m_ItemInfo
*
* @param entity Entity index
* @param type Item info type. See ItemInfo constants.
*
* native rg_get_iteminfo(const ent, ItemInfo:type, any:...);
*/
cell AMX_NATIVE_CALL rg_get_iteminfo(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_index, arg_type, arg_output, arg_length };
CHECK_ISENTITY(arg_index);
CBasePlayerWeapon *pWeapon = getPrivate<CBasePlayerWeapon>(params[arg_index]);
if (unlikely(pWeapon == nullptr)) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: invalid or uninitialized entity", __FUNCTION__);
return FALSE;
}
ItemInfo_e type = static_cast<ItemInfo_e>(params[arg_type]);
if ((type == ItemInfo_pszAmmo1 || type == ItemInfo_pszAmmo2 || type == ItemInfo_pszName) && PARAMS_COUNT != 4) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "Bad arg count. Expected %d, got %d.", 4, PARAMS_COUNT);
return FALSE;
}
if (pWeapon->IsWeapon()) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: #%d entity is not a weapon.", __FUNCTION__, indexOfEdict(pWeapon->pev));
return FALSE;
}
CCSPlayerItem *pItem = pWeapon->CSPlayerItem();
if (unlikely(pItem == nullptr)) {
AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: invalid or uninitialized m_pEntity.", __FUNCTION__);
return FALSE;
}
cell *dest = getAmxAddr(amx, params[arg_output]);
size_t length = *getAmxAddr(amx, params[arg_length]);
switch (type)
{
case ItemInfo_iSlot: return pItem->m_ItemInfo.iSlot;
case ItemInfo_iPosition: return pItem->m_ItemInfo.iPosition;
case ItemInfo_iMaxAmmo1: return pItem->m_ItemInfo.iMaxAmmo1;
case ItemInfo_iMaxAmmo2: return pItem->m_ItemInfo.iMaxAmmo2;
case ItemInfo_iMaxClip: return pItem->m_ItemInfo.iMaxClip;
case ItemInfo_iId: return pItem->m_ItemInfo.iId;
case ItemInfo_iFlags: return pItem->m_ItemInfo.iFlags;
case ItemInfo_iWeight: return pItem->m_ItemInfo.iWeight;
case ItemInfo_pszAmmo1:
{
if (pItem->m_ItemInfo.pszAmmo1 == nullptr) {
setAmxString(dest, "", 1);
break;
}
setAmxString(dest, pItem->m_ItemInfo.pszAmmo1, length);
break;
}
case ItemInfo_pszAmmo2:
{
if (pItem->m_ItemInfo.pszAmmo2 == nullptr) {
setAmxString(dest, "", 1);
break;
}
setAmxString(dest, pItem->m_ItemInfo.pszAmmo2, length);
break;
}
case ItemInfo_pszName:
{
if (pItem->m_ItemInfo.pszName == nullptr) {
setAmxString(dest, "", 1);
break;
}
setAmxString(dest, pItem->m_ItemInfo.pszName, length);
break;
}
default:
AMXX_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", type);
return FALSE;
}
return TRUE;
}
AMX_NATIVE_INFO Misc_Natives_RG[] =
{
{ "rg_set_animation", rg_set_animation },
@ -1999,6 +2160,9 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
{ "rg_send_bartime2", rg_send_bartime2 },
{ "rg_send_audio", rg_send_audio },
{ "rg_set_iteminfo", rg_set_iteminfo },
{ "rg_get_iteminfo", rg_get_iteminfo },
{ nullptr, nullptr }
};

View File

@ -20,13 +20,9 @@
// rewrite on own custom preprocessor definitions INDEXENT and ENTINDEX from cbase.h
#include "type_conversion.h"
#include <cbase.h>
#include <pm_defs.h>
#include <pm_movevars.h>
#include <com_progdefs.h>
#include <gamerules.h>
#include <mapinfo.h>
#include <studio.h>
// metamod SDK
#include <meta_api.h>
@ -34,6 +30,8 @@
// regamedll API
#include <regamedll_api.h>
#include "mod_regamedll_api.h"
#include <mapinfo.h>
#include <studio.h>
// rehlds API
#include <rehlds_api.h>