diff --git a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc index 2643bf5..3aed755 100644 --- a/reapi/extra/amxmodx/scripting/include/cssdk_const.inc +++ b/reapi/extra/amxmodx/scripting/include/cssdk_const.inc @@ -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, diff --git a/reapi/extra/amxmodx/scripting/include/reapi.inc b/reapi/extra/amxmodx/scripting/include/reapi.inc index e95d793..3d08674 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi.inc @@ -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 #include -// 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, diff --git a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc index b8d3770..6affda2 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_engine_const.inc @@ -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 diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc index 867bb47..859603c 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc @@ -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:...); diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index a4f7096..26f5af5 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -40,7 +40,9 @@ enum AccountSet AS_ADD // Adds a value to the account }; -// Weapon info types for use with rg_get_weapon_info() +/** +* Weapon info types for use with rg_set_weapon_info/rg_get_weapon_info() +*/ enum WpnInfo { /* @@ -71,7 +73,7 @@ enum WpnInfo * Description: - * Return type: int * Get params: rg_get_weapon_info(const weapon_id, WI_BUY_CLIP_SIZE); - * Set params: - + * Set params: rg_set_weapon_info(const weapon_id, WI_BUY_CLIP_SIZE, const value); */ WI_BUY_CLIP_SIZE, @@ -79,7 +81,7 @@ enum WpnInfo * Description: - * Return type: int * Get params: rg_get_weapon_info(const weapon_id, WI_GUN_CLIP_SIZE); - * Set params: - + * Set params: rg_set_weapon_info(const weapon_id, WI_GUN_CLIP_SIZE, const value); */ WI_GUN_CLIP_SIZE, @@ -87,7 +89,7 @@ enum WpnInfo * Description: - * Return type: int * Get params: rg_get_weapon_info(const weapon_id, WI_MAX_ROUNDS); - * Set params: - + * Set params: rg_set_weapon_info(const weapon_id, WI_MAX_ROUNDS, const value); */ WI_MAX_ROUNDS, @@ -95,7 +97,7 @@ enum WpnInfo * Description: - * Return type: int * Get params: rg_get_weapon_info(const weapon_id, WI_AMMO_TYPE); - * Set params: - + * Set params: rg_set_weapon_info(const weapon_id, WI_AMMO_TYPE, const value); */ WI_AMMO_TYPE, @@ -116,7 +118,103 @@ enum WpnInfo WI_NAME }; -// Use with rg_give_item +/** +* Item's info types for use with rg_set_iteminfo/rg_get_iteminfo() +*/ +enum ItemInfo +{ + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iSlot); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iSlot, const value); + */ + ItemInfo_iSlot, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iPosition); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iPosition, const value); + */ + ItemInfo_iPosition, + + /* + * Description: - + * Return type: - + * Get params: rg_get_iteminfo(const ent, ItemInfo_pszAmmo1, const output[], maxlenght); + * Set params: rg_set_iteminfo(const ent, ItemInfo_pszAmmo1, const value[]); + */ + ItemInfo_pszAmmo1, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iMaxAmmo1); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iMaxAmmo1, const value); + */ + ItemInfo_iMaxAmmo1, + + /* + * Description: - + * Return type: - + * Get params: rg_get_iteminfo(const ent, ItemInfo_pszAmmo2, const output[], maxlenght); + * Set params: rg_set_iteminfo(const ent, ItemInfo_pszAmmo2, const value[]); + */ + ItemInfo_pszAmmo2, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iMaxAmmo2); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iMaxAmmo2, const value); + */ + ItemInfo_iMaxAmmo2, + + /* + * Description: - + * Return type: - + * Get params: rg_get_iteminfo(const ent, ItemInfo_pszName, const output[], maxlenght); + * Set params: rg_set_iteminfo(const ent, ItemInfo_pszName, const value[]); + */ + ItemInfo_pszName, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iMaxClip); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iMaxClip, const value); + */ + ItemInfo_iMaxClip, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iId); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iId, const value); + */ + ItemInfo_iId, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iFlags); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iFlags, const value); + */ + ItemInfo_iFlags, + + /* + * Description: - + * Return type: int + * Get params: rg_get_iteminfo(const ent, ItemInfo_iWeight); + * Set params: rg_set_iteminfo(const ent, ItemInfo_iWeight, const value); + */ + ItemInfo_iWeight +}; + +/** +* Use with rg_give_item +*/ enum GiveType { GT_APPEND, // Just give item @@ -428,6 +526,7 @@ enum GamedllFunc_CBasePlayer /* * Description: - + * Return type: CBaseEntity * (Entity index of item) * Params: (const this, const pszItemName[]) */ RG_CBasePlayer_DropPlayerItem, @@ -440,6 +539,7 @@ enum GamedllFunc_CBasePlayer /* * Description: Called when a player throws the shield on the ground. + * Return type: CBaseEntity * (Entity index of shield) * Params: (const this, bool:deploy) */ RG_CBasePlayer_DropShield, @@ -639,7 +739,9 @@ enum GamedllFunc_CSGameRules RG_CSGameRules_OnRoundFreezeEnd }; -// CSGameRules +/** +* CSGameRules Members +*/ enum CSGameRules_Members { /* @@ -870,7 +972,7 @@ enum CSGameRules_Members * Description: Whether or not the bomb has been defused. * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bBombDefused, @@ -878,7 +980,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bMapHasBombTarget, @@ -886,7 +988,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bMapHasBombZone, @@ -894,7 +996,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bMapHasBuyZone, @@ -902,7 +1004,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bMapHasRescueZone, @@ -910,7 +1012,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bMapHasEscapeZone, @@ -990,7 +1092,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bLevelInitialized, @@ -998,7 +1100,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bRoundTerminating, @@ -1006,7 +1108,7 @@ enum CSGameRules_Members * Description: Set to TRUE to have the scores reset next time round restarts. * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bCompleteReset, @@ -1038,7 +1140,7 @@ enum CSGameRules_Members * Description: Who can and can't buy. * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bCTCantBuy, @@ -1046,7 +1148,7 @@ enum CSGameRules_Members * Description: Who can and can't buy. * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bTCantBuy, @@ -1239,7 +1341,7 @@ enum CSGameRules_Members * Description: TRUE = the game commencing when there is at least one CT and T, FALSE = scoring will not start until both teams have players (deprecated name m_bFirstConnected) * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bGameStarted, @@ -1247,7 +1349,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bInCareerGame, @@ -1287,7 +1389,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bSkipSpawn, @@ -1295,7 +1397,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bSkipShowMenu, @@ -1303,7 +1405,7 @@ enum CSGameRules_Members * Description: - * Member type: bool * Get params: get_member_game(member); - * Set params: set_member_game(member, value); + * Set params: set_member_game(member, bool:value); */ m_bNeededPlayers, @@ -1316,7 +1418,9 @@ enum CSGameRules_Members m_flEscapeRatio }; -// CBaseEntity +/** +* CBaseEntity Members +*/ enum CBaseEntity_Members { /* @@ -1515,12 +1619,14 @@ enum CBaseEntity_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ has_disconnected, }; -// CBaseAnimating +/** +* CBaseAnimating Members +*/ enum CBaseAnimating_Members { /* @@ -1564,7 +1670,9 @@ enum CBaseAnimating_Members m_fSequenceLoops, }; -// CBaseMonster +/** +* CBaseMonster Members +*/ enum CBaseMonster_Members { /* @@ -1696,7 +1804,9 @@ enum CBaseMonster_Members m_vecEnemyLKP, }; -// CBasePlayer +/** +* CBasePlayer Members +*/ enum CBasePlayer_Members { /* @@ -1751,7 +1861,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bObserverHasDefuser, @@ -1783,7 +1893,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHighDamage, @@ -1807,7 +1917,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bResumeZoom, @@ -1831,7 +1941,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bNotKilled, @@ -1855,7 +1965,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHasPrimary, @@ -1887,7 +1997,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bJustConnected, @@ -1895,7 +2005,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bContextHelp, @@ -1935,7 +2045,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bMissionBriefing, @@ -1943,7 +2053,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bTeamChanged, @@ -1975,7 +2085,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHasNightVision, @@ -1983,7 +2093,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bNightVisionOn, @@ -2023,7 +2133,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bIgnoreRadio, @@ -2031,7 +2141,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHasC4, @@ -2039,7 +2149,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHasDefuser, @@ -2047,7 +2157,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bKilledByBomb, @@ -2063,7 +2173,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bKilledByGrenade, @@ -2111,7 +2221,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bEscaped, @@ -2119,7 +2229,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bIsVIP, @@ -2159,7 +2269,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bJustKilledTeammate, @@ -2183,7 +2293,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bCanShoot, @@ -2207,7 +2317,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHeadshotKilled, @@ -2215,7 +2325,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bPunishedForTK, @@ -2223,7 +2333,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bReceivesNoMoneyNextRound, @@ -2239,7 +2349,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bHasChangedName, @@ -2255,7 +2365,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bIsDefusing, @@ -2975,7 +3085,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bVGUIMenus, @@ -2983,7 +3093,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bShowHints, @@ -2991,7 +3101,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bShieldDrawn, @@ -2999,7 +3109,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bOwnsShield, @@ -3007,7 +3117,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bWasFollowing, @@ -3103,7 +3213,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bIsInRebuy, @@ -3143,7 +3253,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bObserverAutoDirector, @@ -3151,7 +3261,7 @@ enum CBasePlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_canSwitchObserverModes, @@ -3419,7 +3529,7 @@ enum PlayerMove /* * Description: - - * Member type: bool + * Member type: int * Get params: get_pmove(member); * Set params: set_pmove(const PlayerMove:var, value); */ @@ -3427,7 +3537,7 @@ enum PlayerMove /* * Description: - - * Member type: bool + * Member type: int * Get params: get_pmove(member); * Set params: set_pmove(const PlayerMove:var, value); */ @@ -4048,7 +4158,9 @@ enum PMTrace pmt_hitgroup }; -// CCSPlayer +/** +* CCSPlayer API Members +*/ enum CCSPlayer_Members { /* @@ -4063,7 +4175,7 @@ enum CCSPlayer_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_bForceShowMenu, @@ -4076,7 +4188,9 @@ enum CCSPlayer_Members m_flRespawnPending, }; -// CBasePlayerItem +/** +* CBasePlayerItem Members +*/ enum CBasePlayerItem_Members { /* @@ -4104,7 +4218,9 @@ enum CBasePlayerItem_Members m_iId, }; -// CBasePlayerWeapon +/** +* CBasePlayerWeapon Members +*/ enum CBasePlayerWeapon_Members { /* @@ -4231,7 +4347,7 @@ enum CBasePlayerWeapon_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Weapon_bDelayFire, @@ -4247,7 +4363,7 @@ enum CBasePlayerWeapon_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Weapon_bSecondarySilencerOn, @@ -4372,7 +4488,9 @@ enum CBasePlayerWeapon_Members m_Weapon_flLastFireTime }; -// CWeaponBox +/** +* CWeaponBox Members +*/ enum CWeaponBox_Members { /* @@ -4411,12 +4529,14 @@ enum CWeaponBox_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_WeaponBox_bIsBomb, }; -// CArmoury +/** +* CArmoury Members +*/ enum CArmoury_Members { /* @@ -4447,19 +4567,21 @@ enum CArmoury_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Armoury_bAlreadyCounted, }; -// CGrenade +/** +* CGrenade Members +*/ enum CGrenade_Members { /* * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Grenade_bStartDefuse = BEGIN_MEMBER_REGION(grenade), @@ -4467,7 +4589,7 @@ enum CGrenade_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Grenade_bIsC4, @@ -4555,7 +4677,7 @@ enum CGrenade_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Grenade_bJustBlew, @@ -4611,7 +4733,7 @@ enum CGrenade_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Grenade_bLightSmoke, @@ -4619,7 +4741,7 @@ enum CGrenade_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_Grenade_bDetonated, @@ -4648,7 +4770,9 @@ enum CGrenade_Members m_Grenade_fRegisteredSound, }; -// CP228 +/** +* CP228 Members +*/ enum CP228_Members { /* @@ -4668,7 +4792,9 @@ enum CP228_Members m_P228_usFire, }; -// CSCOUT +/** +* CSCOUT Members +*/ enum CSCOUT_Members { /* @@ -4688,7 +4814,9 @@ enum CSCOUT_Members m_SCOUT_usFire, }; -// CHEGrenade +/** +* CHEGrenade Members +*/ enum CHEGrenade_Members { /* @@ -4700,7 +4828,9 @@ enum CHEGrenade_Members m_HEGrenade_usCreate = BEGIN_MEMBER_REGION(hegrenade), }; -// CXM1014 +/** +* CXM1014 Members +*/ enum CXM1014_Members { /* @@ -4728,14 +4858,16 @@ enum CXM1014_Members m_XM1014_usFire, }; -// CC4 +/** +* CC4 Members +*/ enum CC4_Members { /* * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_C4_bStartedArming = BEGIN_MEMBER_REGION(c4), @@ -4743,7 +4875,7 @@ enum CC4_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_C4_bBombPlacedAnimation, @@ -4759,12 +4891,14 @@ enum CC4_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_C4_bHasShield, }; -// CMAC10 +/** +* CMAC10 Members +*/ enum CMAC10_Members { /* @@ -4792,7 +4926,9 @@ enum CMAC10_Members m_MAC10_usFire, }; -// CAUG +/** +* CAUG Members +*/ enum CAUG_Members { /* @@ -4820,7 +4956,9 @@ enum CAUG_Members m_AUG_usFire, }; -// CSmokeGrenade +/** +* CSmokeGrenade Members +*/ enum CSmokeGrenade_Members { /* @@ -4832,7 +4970,9 @@ enum CSmokeGrenade_Members m_SmokeGrenade_usCreate = BEGIN_MEMBER_REGION(smokegrenade), }; -// CELITE +/** +* CELITE Members +*/ enum CELITE_Members { /* @@ -4860,7 +5000,9 @@ enum CELITE_Members m_ELITE_usFire_RIGHT, }; -// CFiveSeven +/** +* CFiveSeven Members +*/ enum CFiveSeven_Members { /* @@ -4880,7 +5022,9 @@ enum CFiveSeven_Members m_FiveSeven_usFire, }; -// CUMP45 +/** +* CUMP45 Members +*/ enum CUMP45_Members { /* @@ -4908,7 +5052,9 @@ enum CUMP45_Members m_UMP45_usFire, }; -// CSG550 +/** +* CSG550 Members +*/ enum CSG550_Members { m_SG550_iShell = BEGIN_MEMBER_REGION(sg550), @@ -4922,7 +5068,9 @@ enum CSG550_Members m_SG550_usFire, }; -// CGalil +/** +* CGalil Members +*/ enum CGalil_Members { /* @@ -4950,7 +5098,9 @@ enum CGalil_Members m_Galil_usFire, }; -// CFamas +/** +* CFamas Members +*/ enum CFamas_Members { /* @@ -4970,7 +5120,9 @@ enum CFamas_Members m_Famas_iShellOn, }; -// CUSP +/** +* CUSP Members +*/ enum CUSP_Members { /* @@ -4990,7 +5142,9 @@ enum CUSP_Members m_USP_usFire, }; -// CGLOCK18 +/** +* CGLOCK18 Members +*/ enum CGLOCK18_Members { /* @@ -5005,12 +5159,14 @@ enum CGLOCK18_Members * Description: - * Member type: bool * Get params: get_member(index, member); - * Set params: set_member(index, member, value); + * Set params: set_member(index, member, bool:value); */ m_GLOCK18_bBurstFire, }; -// CAWP +/** +* CAWP Members +*/ enum CAWP_Members { /* @@ -5030,7 +5186,9 @@ enum CAWP_Members m_AWP_usFire, }; -// CMP5N +/** +* CMP5N Members +*/ enum CMP5N_Members { /* @@ -5058,7 +5216,9 @@ enum CMP5N_Members m_MP5N_usFire, }; -// CM249 +/** +* CM249 Members +*/ enum CM249_Members { /* @@ -5086,7 +5246,9 @@ enum CM249_Members m_M249_usFire, }; -// CM3 +/** +* CM3 Members +*/ enum CM3_Members { m_M3_iShell = BEGIN_MEMBER_REGION(m3), @@ -5108,7 +5270,9 @@ enum CM3_Members m_M3_usFire, }; -// CM4A1 +/** +* CM4A1 Members +*/ enum CM4A1_Members { /* @@ -5136,7 +5300,9 @@ enum CM4A1_Members m_M4A1_usFire, }; -// CTMP +/** +* CTMP Members +*/ enum CTMP_Members { /* @@ -5164,7 +5330,9 @@ enum CTMP_Members m_TMP_usFire, }; -// CG3SG1 +/** +* CG3SG1 Members +*/ enum CG3SG1_Members { /* @@ -5184,7 +5352,9 @@ enum CG3SG1_Members m_G3SG1_usFire, }; -// CDEAGLE +/** +* CDEAGLE Members +*/ enum CDEAGLE_Members { /* @@ -5204,7 +5374,9 @@ enum CDEAGLE_Members m_DEAGLE_usFire, }; -// CSG552 +/** +* CSG552 Members +*/ enum CSG552_Members { /* @@ -5232,7 +5404,9 @@ enum CSG552_Members m_SG552_usFire, }; -// CAK47 +/** +* CAK47 Members +*/ enum CAK47_Members { /* @@ -5260,7 +5434,9 @@ enum CAK47_Members m_AK47_usFire, }; -// CKnife +/** +* CKnife Members +*/ enum CKnife_Members { /* @@ -5280,7 +5456,9 @@ enum CKnife_Members m_Knife_usKnife, }; -// CP90 +/** +* CP90 Members +*/ enum CP90_Members { /* @@ -5308,7 +5486,9 @@ enum CP90_Members m_P90_usFire, }; -// CWShield +/** +* CWShield Members +*/ enum CShield_Members { /* @@ -5328,7 +5508,9 @@ enum CShield_Members m_Shield_flTimeToIgnoreTouches, }; -// CMapInfo +/** +* CMapInfo Members +*/ enum CMapInfo_Members { /* @@ -5347,3 +5529,17 @@ enum CMapInfo_Members */ m_MapInfo_flBombRadius, }; + +/** +* CCSPlayerWeapon API Members +*/ +enum CCSPlayerWeapon_Members +{ + /* + * Description: Can the weapon have secondary attack + * Member type: bool + * Get params: get_member(index, member); + * Set params: set_member(index, member, bool:value); + */ + m_Weapon_bHasSecondaryAttack = BEGIN_MEMBER_REGION(csplayerweapon), +}; diff --git a/reapi/include/cssdk/dlls/API/CSEntity.h b/reapi/include/cssdk/dlls/API/CSEntity.h new file mode 100644 index 0000000..ef47f30 --- /dev/null +++ b/reapi/include/cssdk/dlls/API/CSEntity.h @@ -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: + +}; diff --git a/reapi/include/cssdk/dlls/regamedll_interfaces.h b/reapi/include/cssdk/dlls/API/CSInterfaces.h similarity index 74% rename from reapi/include/cssdk/dlls/regamedll_interfaces.h rename to reapi/include/cssdk/dlls/API/CSInterfaces.h index 639a008..74c541e 100644 --- a/reapi/include/cssdk/dlls/regamedll_interfaces.h +++ b/reapi/include/cssdk/dlls/API/CSInterfaces.h @@ -28,90 +28,17 @@ #pragma once -class CBaseEntity; -class CBasePlayer; +#include +#include -// 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(this->m_pContainingEntity); -} +class CCSTriggerSetOrigin: public CCSDelay {}; +class CCSItemAirBox: public CCSArmoury {}; diff --git a/reapi/include/cssdk/dlls/API/CSPlayer.h b/reapi/include/cssdk/dlls/API/CSPlayer.h new file mode 100644 index 0000000..7b9b1fb --- /dev/null +++ b/reapi/include/cssdk/dlls/API/CSPlayer.h @@ -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 +#include + +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(this->m_pContainingEntity); +} diff --git a/reapi/include/cssdk/dlls/API/CSPlayerItem.h b/reapi/include/cssdk/dlls/API/CSPlayerItem.h new file mode 100644 index 0000000..8c47d6e --- /dev/null +++ b/reapi/include/cssdk/dlls/API/CSPlayerItem.h @@ -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(this->m_pContainingEntity); +} diff --git a/reapi/include/cssdk/dlls/API/CSPlayerWeapon.h b/reapi/include/cssdk/dlls/API/CSPlayerWeapon.h new file mode 100644 index 0000000..32e32f9 --- /dev/null +++ b/reapi/include/cssdk/dlls/API/CSPlayerWeapon.h @@ -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(this->m_pContainingEntity); +} diff --git a/reapi/include/cssdk/dlls/cbase.h b/reapi/include/cssdk/dlls/cbase.h index 53d7f0e..c72b919 100644 --- a/reapi/include/cssdk/dlls/cbase.h +++ b/reapi/include/cssdk/dlls/cbase.h @@ -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 + 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 + 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 + 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 + 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 +inline void CBaseEntity::SetThink(void (T::*pfn)()) +{ + m_pfnThink = static_cast(pfn); +} + +inline void CBaseEntity::SetThink(std::nullptr_t) +{ + m_pfnThink = nullptr; +} + +template +inline void CBaseEntity::SetTouch(void (T::*pfn)(CBaseEntity *pOther)) +{ + m_pfnTouch = static_cast(pfn); +} + +inline void CBaseEntity::SetTouch(std::nullptr_t) +{ + m_pfnTouch = nullptr; +} + +template +inline void CBaseEntity::SetUse(void (T::*pfn)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)) +{ + m_pfnUse = static_cast(pfn); +} + +inline void CBaseEntity::SetUse(std::nullptr_t) +{ + m_pfnUse = nullptr; +} + +template +inline void CBaseEntity::SetBlocked(void (T::*pfn)(CBaseEntity *pOther)) +{ + m_pfnBlocked = static_cast(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 + 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 +inline void CBaseToggle::SetMoveDone(void (T::*pfn)()) +{ + m_pfnCallWhenMoveDone = static_cast(pfn); +} + +inline void CBaseToggle::SetMoveDone(std::nullptr_t) +{ + m_pfnCallWhenMoveDone = nullptr; +} + #include "basemonster.h" -#include "weapons.h" #include "player.h" // Generic Button diff --git a/reapi/include/cssdk/dlls/csbot_dll.h b/reapi/include/cssdk/dlls/csbot_dll.h index f96b728..4e01f70 100644 --- a/reapi/include/cssdk/dlls/csbot_dll.h +++ b/reapi/include/cssdk/dlls/csbot_dll.h @@ -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" diff --git a/reapi/include/cssdk/dlls/hookchains.h b/reapi/include/cssdk/dlls/hookchains.h index 7ea472a..38b8747 100644 --- a/reapi/include/cssdk/dlls/hookchains.h +++ b/reapi/include/cssdk/dlls/hookchains.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once template diff --git a/reapi/include/cssdk/dlls/player.h b/reapi/include/cssdk/dlls/player.h index 53a9652..2e948d5 100644 --- a/reapi/include/cssdk/dlls/player.h +++ b/reapi/include/cssdk/dlls/player.h @@ -25,8 +25,10 @@ * version. * */ + #pragma once +#include "weapons.h" #include "pm_materials.h" #include "hintmessage.h" #include "unisignals.h" diff --git a/reapi/include/cssdk/dlls/regamedll_api.h b/reapi/include/cssdk/dlls/regamedll_api.h index 5cefdd5..d23e2a8 100644 --- a/reapi/include/cssdk/dlls/regamedll_api.h +++ b/reapi/include/cssdk/dlls/regamedll_api.h @@ -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 +#include +#include +#include +#include +#include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 3 +#define REGAMEDLL_API_VERSION_MINOR 4 // CBasePlayer::Spawn hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Spawn; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; +typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; // CBasePlayer::Precache hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Precache; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; +typedef IHookChainClass IReGameHook_CBasePlayer_Precache; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; // CBasePlayer::ObjectCaps hook typedef IHookChainClass IReGameHook_CBasePlayer_ObjectCaps; @@ -55,8 +57,8 @@ typedef IHookChainClass IReGameHook_CBasePlayer_Classify typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Classify; // CBasePlayer::TraceAttack hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_TraceAttack; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; +typedef IHookChainClass IReGameHook_CBasePlayer_TraceAttack; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; // CBasePlayer::TakeDamage hook typedef IHookChainClass IReGameHook_CBasePlayer_TakeDamage; @@ -67,16 +69,16 @@ typedef IHookChainClass IReGameHook_CBasePl typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TakeHealth; // CBasePlayer::Killed hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Killed; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; +typedef IHookChainClass IReGameHook_CBasePlayer_Killed; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; // CBasePlayer::AddPoints hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPoints; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; +typedef IHookChainClass IReGameHook_CBasePlayer_AddPoints; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; // CBasePlayer::AddPointsToTeam hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; +typedef IHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; // CBasePlayer::AddPlayerItem hook typedef IHookChainClass IReGameHook_CBasePlayer_AddPlayerItem; @@ -91,68 +93,68 @@ typedef IHookChainClass IReGame typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveAmmo; // CBasePlayer::ResetMaxSpeed hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; +typedef IHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; // CBasePlayer::Jump hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Jump; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; +typedef IHookChainClass IReGameHook_CBasePlayer_Jump; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; // CBasePlayer::Duck hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Duck; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; +typedef IHookChainClass IReGameHook_CBasePlayer_Duck; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; // CBasePlayer::PreThink hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_PreThink; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; +typedef IHookChainClass IReGameHook_CBasePlayer_PreThink; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; // CBasePlayer::PostThink hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_PostThink; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; +typedef IHookChainClass IReGameHook_CBasePlayer_PostThink; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; // CBasePlayer::UpdateClientData hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_UpdateClientData; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; +typedef IHookChainClass IReGameHook_CBasePlayer_UpdateClientData; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; // CBasePlayer::ImpulseCommands hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; +typedef IHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; // CBasePlayer::RoundRespawn hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_RoundRespawn; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; +typedef IHookChainClass IReGameHook_CBasePlayer_RoundRespawn; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; // CBasePlayer::Blind hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Blind; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; +typedef IHookChainClass IReGameHook_CBasePlayer_Blind; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; // CBasePlayer::Observer_IsValidTarget hook typedef IHookChainClass IReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; // CBasePlayer::SetAnimation hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetAnimation; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; +typedef IHookChainClass IReGameHook_CBasePlayer_SetAnimation; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; // CBasePlayer::GiveDefaultItems hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; +typedef IHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; // CBasePlayer::GiveNamedItem hook typedef IHookChainClass IReGameHook_CBasePlayer_GiveNamedItem; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveNamedItem; // CBasePlayer::AddAccount hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddAccount; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; +typedef IHookChainClass IReGameHook_CBasePlayer_AddAccount; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; // CBasePlayer::GiveShield hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveShield; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; +typedef IHookChainClass IReGameHook_CBasePlayer_GiveShield; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; // CBasePlayer:SetClientUserInfoModel hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; // CBasePlayer:SetClientUserInfoName hook typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoName; @@ -163,56 +165,56 @@ typedef IHookChainClass IReGameHo typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HasRestrictItem; // CBasePlayer::DropPlayerItem hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; +typedef IHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; // CBasePlayer::DropShield hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropShield; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; +typedef IHookChainClass IReGameHook_CBasePlayer_DropShield; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; // CBasePlayer::OnSpawnEquip hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; +typedef IHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; // CBasePlayer::Radio hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Radio; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; +typedef IHookChainClass IReGameHook_CBasePlayer_Radio; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; // CBasePlayer::Disappear hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_Disappear; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; +typedef IHookChainClass IReGameHook_CBasePlayer_Disappear; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; // CBasePlayer::MakeVIP hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_MakeVIP; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; +typedef IHookChainClass IReGameHook_CBasePlayer_MakeVIP; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; // CBasePlayer::MakeBomber hook typedef IHookChainClass IReGameHook_CBasePlayer_MakeBomber; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeBomber; // CBasePlayer::StartObserver hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_StartObserver; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; +typedef IHookChainClass IReGameHook_CBasePlayer_StartObserver; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; // CBasePlayer::GetIntoGame hook typedef IHookChainClass IReGameHook_CBasePlayer_GetIntoGame; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GetIntoGame; // CBaseAnimating::ResetSequenceInfo hook -typedef IVoidHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; +typedef IHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; // GetForceCamera hook typedef IHookChain IReGameHook_GetForceCamera; typedef IHookChainRegistry IReGameHookRegistry_GetForceCamera; // PlayerBlind hook -typedef IVoidHookChain IReGameHook_PlayerBlind; -typedef IVoidHookChainRegistry IReGameHookRegistry_PlayerBlind; +typedef IHookChain IReGameHook_PlayerBlind; +typedef IHookChainRegistry IReGameHookRegistry_PlayerBlind; // RadiusFlash_TraceLine hook -typedef IVoidHookChain IReGameHook_RadiusFlash_TraceLine; -typedef IVoidHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; +typedef IHookChain IReGameHook_RadiusFlash_TraceLine; +typedef IHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; // RoundEnd hook typedef IHookChain IReGameHook_RoundEnd; @@ -223,32 +225,32 @@ typedef IHookChain IReGameHook_InstallGameRules; typedef IHookChainRegistry IReGameHookRegistry_InstallGameRules; // PM_Init hook -typedef IVoidHookChain IReGameHook_PM_Init; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Init; +typedef IHookChain IReGameHook_PM_Init; +typedef IHookChainRegistry IReGameHookRegistry_PM_Init; // PM_Move hook -typedef IVoidHookChain IReGameHook_PM_Move; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Move; +typedef IHookChain IReGameHook_PM_Move; +typedef IHookChainRegistry IReGameHookRegistry_PM_Move; // PM_AirMove hook -typedef IVoidHookChain IReGameHook_PM_AirMove; -typedef IVoidHookChainRegistry IReGameHookRegistry_PM_AirMove; +typedef IHookChain IReGameHook_PM_AirMove; +typedef IHookChainRegistry IReGameHookRegistry_PM_AirMove; // HandleMenu_ChooseAppearance hook -typedef IVoidHookChain IReGameHook_HandleMenu_ChooseAppearance; -typedef IVoidHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; +typedef IHookChain IReGameHook_HandleMenu_ChooseAppearance; +typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; // HandleMenu_ChooseTeam hook typedef IHookChain IReGameHook_HandleMenu_ChooseTeam; typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseTeam; // ShowMenu hook -typedef IVoidHookChain IReGameHook_ShowMenu; -typedef IVoidHookChainRegistry IReGameHookRegistry_ShowMenu; +typedef IHookChain IReGameHook_ShowMenu; +typedef IHookChainRegistry IReGameHookRegistry_ShowMenu; // ShowVGUIMenu hook -typedef IVoidHookChain IReGameHook_ShowVGUIMenu; -typedef IVoidHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; +typedef IHookChain IReGameHook_ShowVGUIMenu; +typedef IHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; // BuyGunAmmo hook typedef IHookChain IReGameHook_BuyGunAmmo; @@ -259,8 +261,8 @@ typedef IHookChain IReGa typedef IHookChainRegistry IReGameHookRegistry_BuyWeaponByWeaponID; // InternalCommand hook -typedef IHookChain IReGameHook_InternalCommand; -typedef IHookChainRegistry IReGameHookRegistry_InternalCommand; +typedef IHookChain IReGameHook_InternalCommand; +typedef IHookChainRegistry IReGameHookRegistry_InternalCommand; // CHalfLifeMultiplay::FShouldSwitchWeapon hook typedef IHookChain IReGameHook_CSGameRules_FShouldSwitchWeapon; @@ -279,8 +281,8 @@ typedef IHookChain IReGameHook_CSGameR typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage; // CHalfLifeMultiplay::PlayerSpawn hook -typedef IVoidHookChain IReGameHook_CSGameRules_PlayerSpawn; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; +typedef IHookChain IReGameHook_CSGameRules_PlayerSpawn; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; // CHalfLifeMultiplay::FPlayerCanRespawn hook typedef IHookChain IReGameHook_CSGameRules_FPlayerCanRespawn; @@ -291,16 +293,16 @@ typedef IHookChain IReGameHook_CSGameRule typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot; // CHalfLifeMultiplay::ClientUserInfoChanged hook -typedef IVoidHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; +typedef IHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; // CHalfLifeMultiplay::PlayerKilled hook -typedef IVoidHookChain IReGameHook_CSGameRules_PlayerKilled; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; +typedef IHookChain IReGameHook_CSGameRules_PlayerKilled; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; // CHalfLifeMultiplay::DeathNotice hook -typedef IVoidHookChain IReGameHook_CSGameRules_DeathNotice; -typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; +typedef IHookChain IReGameHook_CSGameRules_DeathNotice; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; // CHalfLifeMultiplay::CanHavePlayerItem hook typedef IHookChain IReGameHook_CSGameRules_CanHavePlayerItem; @@ -311,147 +313,147 @@ typedef IHookChain IReGameHook_CSGameRules_DeadPlayerW typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeadPlayerWeapons; // CHalfLifeMultiplay::ServerDeactivate hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_ServerDeactivate; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ServerDeactivate; +typedef IHookChain IReGameHook_CSGameRules_ServerDeactivate; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ServerDeactivate; // CHalfLifeMultiplay::CheckMapConditions hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckMapConditions; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckMapConditions; +typedef IHookChain IReGameHook_CSGameRules_CheckMapConditions; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckMapConditions; // CHalfLifeMultiplay::CleanUpMap hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CleanUpMap; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CleanUpMap; +typedef IHookChain IReGameHook_CSGameRules_CleanUpMap; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CleanUpMap; // CHalfLifeMultiplay::RestartRound hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_RestartRound; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RestartRound; +typedef IHookChain IReGameHook_CSGameRules_RestartRound; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RestartRound; // CHalfLifeMultiplay::CheckWinConditions hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckWinConditions; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckWinConditions; +typedef IHookChain IReGameHook_CSGameRules_CheckWinConditions; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckWinConditions; // CHalfLifeMultiplay::RemoveGuns hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_RemoveGuns; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RemoveGuns; +typedef IHookChain IReGameHook_CSGameRules_RemoveGuns; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_GiveC4; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GiveC4; +typedef IHookChain IReGameHook_CSGameRules_GiveC4; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_ChangeLevel; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ChangeLevel; +typedef IHookChain IReGameHook_CSGameRules_ChangeLevel; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ChangeLevel; // CHalfLifeMultiplay::GoToIntermission hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_GoToIntermission; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermission; +typedef IHookChain IReGameHook_CSGameRules_GoToIntermission; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GoToIntermission; // CHalfLifeMultiplay::BalanceTeams hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams; +typedef IHookChain IReGameHook_CSGameRules_BalanceTeams; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_BalanceTeams; // CHalfLifeMultiplay::OnRoundFreezeEnd hook -typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; +typedef IHookChain IReGameHook_CSGameRules_OnRoundFreezeEnd; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; // PM_UpdateStepSound hook -typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound; -typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound; +typedef IHookChain IReGameHook_PM_UpdateStepSound; +typedef IHookChainRegistry IReGameHookRegistry_PM_UpdateStepSound; // CBasePlayer::StartDeathCam hook -typedef IVoidHookChainClass IReGameHook_CBasePlayer_StartDeathCam; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartDeathCam; +typedef IHookChainClass IReGameHook_CBasePlayer_StartDeathCam; +typedef IHookChainRegistryClass 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" diff --git a/reapi/include/cssdk/dlls/regamedll_const.h b/reapi/include/cssdk/dlls/regamedll_const.h index 36d038b..ddbe62a 100644 --- a/reapi/include/cssdk/dlls/regamedll_const.h +++ b/reapi/include/cssdk/dlls/regamedll_const.h @@ -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 diff --git a/reapi/include/cssdk/dlls/saverestore.h b/reapi/include/cssdk/dlls/saverestore.h new file mode 100644 index 0000000..c579ebc --- /dev/null +++ b/reapi/include/cssdk/dlls/saverestore.h @@ -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; diff --git a/reapi/include/cssdk/dlls/schedule.h b/reapi/include/cssdk/dlls/schedule.h new file mode 100644 index 0000000..67cb43c --- /dev/null +++ b/reapi/include/cssdk/dlls/schedule.h @@ -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; +}; diff --git a/reapi/include/cssdk/dlls/weapons.h b/reapi/include/cssdk/dlls/weapons.h index 9ce376c..a1862cc 100644 --- a/reapi/include/cssdk/dlls/weapons.h +++ b/reapi/include/cssdk/dlls/weapons.h @@ -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(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(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); } diff --git a/reapi/include/cssdk/dlls/weapontype.h b/reapi/include/cssdk/dlls/weapontype.h index 784f804..a6bcd8b 100644 --- a/reapi/include/cssdk/dlls/weapontype.h +++ b/reapi/include/cssdk/dlls/weapontype.h @@ -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 diff --git a/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index ed364f7..74259a6 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -378,24 +378,24 @@ bool CBasePlayer_HasRestrictItem(IReGameHook_CBasePlayer_HasRestrictItem *chain, return callForward(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(_pthis), _pszItemName); + return indexOfPDataAmx(chain->callNext(getPrivate(_pthis), _pszItemName)); }; - callVoidForward(RG_CBasePlayer_DropPlayerItem, original, indexOfEdict(pthis->pev), pszItemName); + return getPrivate(callForward(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(_pthis), _bDeploy); + return indexOfPDataAmx(chain->callNext(getPrivate(_pthis), _bDeploy)); }; - callVoidForward(RG_CBasePlayer_DropShield, original, indexOfEdict(pthis->pev), bDeploy); + return getPrivate(callForward(RG_CBasePlayer_DropShield, original, indexOfEdict(pthis->pev), bDeploy)); } void CBasePlayer_OnSpawnEquip(IReGameHook_CBasePlayer_OnSpawnEquip *chain, CBasePlayer *pthis, bool addDefault, bool equipGame) diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index da3df5b..8e5ecfc 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -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); diff --git a/reapi/src/member_list.cpp b/reapi/src/member_list.cpp index 5091a3c..13f878f 100644 --- a/reapi/src/member_list.cpp +++ b/reapi/src/member_list.cpp @@ -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; diff --git a/reapi/src/member_list.h b/reapi/src/member_list.h index f197854..ead87b8 100644 --- a/reapi/src/member_list.h +++ b/reapi/src/member_list.h @@ -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), +}; diff --git a/reapi/src/natives/natives_members.cpp b/reapi/src/natives/natives_members.cpp index b953f98..b3cba8f 100644 --- a/reapi/src/natives/natives_members.cpp +++ b/reapi/src/natives/natives_members.cpp @@ -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(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(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; +} diff --git a/reapi/src/natives/natives_members.h b/reapi/src/natives/natives_members.h index d643ae9..3af37b6 100644 --- a/reapi/src/natives/natives_members.h +++ b/reapi/src/natives/natives_members.h @@ -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); diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index e654972..91fd9f6 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -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(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(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(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(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 } }; diff --git a/reapi/src/precompiled.h b/reapi/src/precompiled.h index b0cb9bb..742ef8c 100644 --- a/reapi/src/precompiled.h +++ b/reapi/src/precompiled.h @@ -20,13 +20,9 @@ // rewrite on own custom preprocessor definitions INDEXENT and ENTINDEX from cbase.h #include "type_conversion.h" -#include #include #include #include -#include -#include -#include // metamod SDK #include @@ -34,6 +30,8 @@ // regamedll API #include #include "mod_regamedll_api.h" +#include +#include // rehlds API #include