From da591f8cb3e27afe7679106e450af336e47dd773 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 02:51:40 +0700 Subject: [PATCH 01/15] QuaternionSlerp: Fix GCC issue & minor refactoring (Reversing thing mistake) --- regamedll/dlls/animation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index e8f0ab0f5..3382ea48d 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -615,22 +615,22 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt) float sclp, sclq; float cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]); - if ((1.0 + cosom) > 0.00000001) + if ((1.0f + cosom) > 0.000001f) { - if ((1.0 - cosom) > 0.00000001) + if ((1.0f - cosom) > 0.000001f) { real_t cosomega = Q_acos(real_t(cosom)); float omega = cosomega; float sinom = Q_sin(cosomega); - sclp = Q_sin((1.0 - t) * omega) / sinom; + sclp = Q_sin((1.0f - t) * omega) / sinom; sclq = Q_sin(real_t(omega * t)) / sinom; } else { sclq = t; - sclp = 1.0 - t; + sclp = 1.0f - t; } for (i = 0; i < 4; i++) @@ -643,8 +643,8 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt) qt[2] = -q[3]; qt[3] = q[2]; - sclp = Q_sin((1.0 - t) * 0.5 * M_PI); - sclq = Q_sin(t * 0.5 * M_PI); + sclp = Q_sin((1.0f - t) * (0.5f * M_PI)); + sclq = Q_sin(t * (0.5f * M_PI)); for (i = 0; i < 3; i++) qt[i] = sclp * p[i] + sclq * qt[i]; From 3ce937a1dbfa4d700538a7651181575e44eed299 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 03:45:18 +0700 Subject: [PATCH 02/15] Unittest-win: Fixed demo failed --- regamedll/dlls/animation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index 3382ea48d..d639b08f4 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -615,9 +615,9 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt) float sclp, sclq; float cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]); - if ((1.0f + cosom) > 0.000001f) + if ((1.0 + cosom) > 0.000001) { - if ((1.0f - cosom) > 0.000001f) + if ((1.0 - cosom) > 0.000001) { real_t cosomega = Q_acos(real_t(cosom)); From 54a0f5f2440784761c1d41f60b54eca238752fda Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 03:56:03 +0700 Subject: [PATCH 03/15] SV_StudioSetupBones: make local vars as static to avoid larger stack size. --- regamedll/dlls/animation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index d639b08f4..d61b9a3e3 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -977,8 +977,8 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t float bonematrix[3][4]; vec3_t temp_angles; - /*static */float pos[MAXSTUDIOBONES][3], pos2[MAXSTUDIOBONES][3]; - /*static */float q[MAXSTUDIOBONES][4], q2[MAXSTUDIOBONES][4]; + static float pos[MAXSTUDIOBONES][3] = {}, pos2[MAXSTUDIOBONES][3] = {}; + static float q[MAXSTUDIOBONES][4] = {}, q2[MAXSTUDIOBONES][4] = {}; g_pstudiohdr = (studiohdr_t *)IEngineStudio.Mod_Extradata(pModel); @@ -1030,8 +1030,8 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t // This game knows how to do nine way blending else { - /*static */float pos3[MAXSTUDIOBONES][3], pos4[MAXSTUDIOBONES][3]; - /*static */float q3[MAXSTUDIOBONES][4], q4[MAXSTUDIOBONES][4]; + static float pos3[MAXSTUDIOBONES][3] = {}, pos4[MAXSTUDIOBONES][3] = {}; + static float q3[MAXSTUDIOBONES][4] = {}, q4[MAXSTUDIOBONES][4] = {}; real_t s, t; s = GetPlayerYaw(pEdict); From a7f20dc2e8e7cf9effb6a9e45091a8f666944a96 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 04:26:55 +0700 Subject: [PATCH 04/15] Implemented command param -beta to enables latest things from official. --- README.md | 8 +++-- dist/game.cfg | 2 ++ regamedll/dlls/client.cpp | 7 ++-- regamedll/dlls/game.cpp | 7 ++-- regamedll/dlls/globals.cpp | 1 + regamedll/dlls/globals.h | 1 + regamedll/dlls/multiplay_gamerules.cpp | 19 +++++----- regamedll/dlls/player.cpp | 49 ++++++++++++++------------ regamedll/dlls/util.cpp | 22 ++++++++++++ regamedll/dlls/util.h | 1 + regamedll/regamedll/regamedll.cpp | 5 +-- regamedll/regamedll/regamedll.h | 5 +++ 12 files changed, 88 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index c264b9d09..128420966 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' Warning! ReGameDLL_CS is not binary compatible with original hlds since it's compiled with compilers other than ones used for original mod CS. This means that plugins that do binary code analysis (Orpheu for example) probably will not work with ReGameDLL_CS. +## How can use beta? +ReGameDLL_CS also have beta version with latest changes from official version of Counter-Strike, +therefore for this enter `-beta` option at the command line HLDS. + ## Configuration (cvars) | CVar | Default | Min | Max | Description | | :--------------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- | @@ -56,8 +60,8 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | mp_kill_filled_spawn | 1 | 0 | 1 | Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).
Only disable this if you have semiclip or other plugins that prevents stucking.
`0` disabled
`1` enabled | | mp_allow_point_servercommand | 0 | 0 | 1 | Allow use of point_servercommand entities in map.
`0` disallow
`1` allow
`NOTE`: Potentially dangerous for untrusted maps.| | mp_hullbounds_sets | 1 | 0 | 1 | Sets mins/maxs hull bounds for the player.
`0` disabled
`1` enabled | -| mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.
`0` don't send any update for `HP` field to any clients
`1` show only Terrorist `HP` field to all clients
`2` show only CT `HP` field to all clients
`3` show `HP` field to teammates
`4` show `HP` field to all clients
`5` show `HP` field to teammates and spectators | -| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.
`0` don't send any update for `Money` field to any clients
`1` show only Terrorist `Money` field to all clients
`2` show only CT `Money` field to all clients
`3` show `Money` field to teammates
`4` show `Money` field to all clients
`5` show `Money` field to teammates and spectators | +| mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.
`0` don't send any update for `HP` field to any clients
`1` show only Terrorist `HP` field to all clients
`2` show only CT `HP` field to all clients
`3` show `HP` field to teammates
`4` show `HP` field to all clients
`5` show `HP` field to teammates and spectators

`Note this CVar are work in beta only.` | +| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.
`0` don't send any update for `Money` field to any clients
`1` show only Terrorist `Money` field to all clients
`2` show only CT `Money` field to all clients
`3` show `Money` field to teammates
`4` show `Money` field to all clients
`5` show `Money` field to teammates and spectators

`Note this CVar are work in beta only.` | | ff_damage_reduction_bullets | 0.35 | 0.0 | 1.0 | How much to reduce damage done to teammates when shot.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | | ff_damage_reduction_grenade | 0.25 | 0.0 | 1.0 | How much to reduce damage done to teammates by a thrown grenade.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | | ff_damage_reduction_grenade_self | 1.0 | 0.0 | 1.0 | How much to damage a player does to himself with his own grenade.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | diff --git a/dist/game.cfg b/dist/game.cfg index fb8f3e4e1..f3a08b204 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -245,6 +245,7 @@ mp_allow_point_servercommand 0 // 3 - show 'HP' field to teammates // 4 - show 'HP' field to all clients // 5 - show 'HP' field to teammates and spectators +// Note this CVar are work in beta only. // // Default value: "3" mp_scoreboard_showhealth 3 @@ -256,6 +257,7 @@ mp_scoreboard_showhealth 3 // 3 - show 'Money' field to teammates // 4 - show 'Money' field to all clients // 5 - show 'Money' field to teammates and spectators +// Note this CVar are work in beta only. // // Default value: "3" mp_scoreboard_showmoney 3 diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 6b3e42b74..204e6081a 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -226,8 +226,11 @@ void LinkUserMessages() gmsgHudTextArgs = REG_USER_MSG("HudTextArgs", -1); #ifdef BUILD_LATEST - gmsgAccount = REG_USER_MSG("Account", 5); - gmsgHealthInfo = REG_USER_MSG("HealthInfo", 5); + if (AreRunningBeta()) + { + gmsgAccount = REG_USER_MSG("Account", 5); + gmsgHealthInfo = REG_USER_MSG("HealthInfo", 5); + } #endif } diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index f2c5e8ec8..1ffbd8ff3 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -235,8 +235,11 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&humans_join_team); #ifdef BUILD_LATEST - CVAR_REGISTER(&scoreboard_showhealth); - CVAR_REGISTER(&scoreboard_showmoney); + if (AreRunningBeta()) + { + CVAR_REGISTER(&scoreboard_showhealth); + CVAR_REGISTER(&scoreboard_showmoney); + } #endif // Remove unused cvars diff --git a/regamedll/dlls/globals.cpp b/regamedll/dlls/globals.cpp index 69efe5324..70d9a8c53 100644 --- a/regamedll/dlls/globals.cpp +++ b/regamedll/dlls/globals.cpp @@ -8,6 +8,7 @@ int g_iSkillLevel; Vector g_vecAttackDir; BOOL gDisplayTitle; +bool g_bIsBeta = false; bool g_bIsCzeroGame = false; bool g_bAllowedCSBot = false; bool g_bHostageImprov = false; diff --git a/regamedll/dlls/globals.h b/regamedll/dlls/globals.h index 20e0cc334..d6a470232 100644 --- a/regamedll/dlls/globals.h +++ b/regamedll/dlls/globals.h @@ -35,6 +35,7 @@ extern int g_iSkillLevel; extern Vector g_vecAttackDir; extern BOOL gDisplayTitle; +extern bool g_bIsBeta; extern bool g_bIsCzeroGame; extern bool g_bAllowedCSBot; extern bool g_bHostageImprov; diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 45ffcb2d8..3737c41da 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -3362,15 +3362,18 @@ void CHalfLifeMultiplay::InitHUD(CBasePlayer *pl) } #ifdef BUILD_LATEST - MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pl->edict()); - WRITE_BYTE(plr->entindex()); - WRITE_LONG(plr->ShouldToShowHealthInfo(pl) ? plr->m_iClientHealth : -1 /* means that 'HP' field will be hidden */); - MESSAGE_END(); + if (AreRunningBeta()) + { + MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pl->edict()); + WRITE_BYTE(plr->entindex()); + WRITE_LONG(plr->ShouldToShowHealthInfo(pl) ? plr->m_iClientHealth : -1 /* means that 'HP' field will be hidden */); + MESSAGE_END(); - MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pl->edict()); - WRITE_BYTE(plr->entindex()); - WRITE_LONG(plr->ShouldToShowAccount(pl) ? plr->m_iAccount : -1 /* means that this 'Money' will be hidden */); - MESSAGE_END(); + MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pl->edict()); + WRITE_BYTE(plr->entindex()); + WRITE_LONG(plr->ShouldToShowAccount(pl) ? plr->m_iAccount : -1 /* means that this 'Money' will be hidden */); + MESSAGE_END(); + } #endif // BUILD_LATEST } diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 651b695eb..7f5223165 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -5123,7 +5123,7 @@ void CBasePlayer::SetScoreAttrib(CBasePlayer *dest) state |= SCORE_STATUS_VIP; #ifdef BUILD_LATEST - if (m_bHasDefuser) + if (AreRunningBeta() && m_bHasDefuser) state |= SCORE_STATUS_DEFKIT; #endif @@ -7132,38 +7132,41 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)() } #ifdef BUILD_LATEST - if ((m_iTeam == CT || m_iTeam == TERRORIST) && - (m_iLastAccount != m_iAccount || m_iLastClientHealth != m_iClientHealth || m_tmNextAccountHealthUpdate < gpGlobals->time)) + if (AreRunningBeta()) { - m_tmNextAccountHealthUpdate = gpGlobals->time + 5.0f; - - for (int playerIndex = 1; playerIndex <= gpGlobals->maxClients; playerIndex++) + if ((m_iTeam == CT || m_iTeam == TERRORIST) && + (m_iLastAccount != m_iAccount || m_iLastClientHealth != m_iClientHealth || m_tmNextAccountHealthUpdate < gpGlobals->time)) { - CBaseEntity *pEntity = UTIL_PlayerByIndex(playerIndex); + m_tmNextAccountHealthUpdate = gpGlobals->time + 5.0f; - if (!pEntity) - continue; + for (int playerIndex = 1; playerIndex <= gpGlobals->maxClients; playerIndex++) + { + CBaseEntity *pEntity = UTIL_PlayerByIndex(playerIndex); + + if (!pEntity) + continue; - CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pEntity->pev); + CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pEntity->pev); #ifdef REGAMEDLL_FIXES - if (pPlayer->IsDormant()) - continue; + if (pPlayer->IsDormant()) + continue; #endif // REGAMEDLL_FIXES - MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pPlayer->edict()); - WRITE_BYTE(entindex()); - WRITE_LONG(ShouldToShowHealthInfo(pPlayer) ? m_iClientHealth : -1 /* means that 'HP' field will be hidden */); - MESSAGE_END(); + MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pPlayer->edict()); + WRITE_BYTE(entindex()); + WRITE_LONG(ShouldToShowHealthInfo(pPlayer) ? m_iClientHealth : -1 /* means that 'HP' field will be hidden */); + MESSAGE_END(); - MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pPlayer->edict()); - WRITE_BYTE(entindex()); - WRITE_LONG(ShouldToShowAccount(pPlayer) ? m_iAccount : -1 /* means that this 'Money' will be hidden */); - MESSAGE_END(); - } + MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pPlayer->edict()); + WRITE_BYTE(entindex()); + WRITE_LONG(ShouldToShowAccount(pPlayer) ? m_iAccount : -1 /* means that this 'Money' will be hidden */); + MESSAGE_END(); + } - m_iLastAccount = m_iAccount; - m_iLastClientHealth = m_iClientHealth; + m_iLastAccount = m_iAccount; + m_iLastClientHealth = m_iClientHealth; + } } #endif // #ifdef BUILD_LATEST } diff --git a/regamedll/dlls/util.cpp b/regamedll/dlls/util.cpp index c38a85a16..3038b223d 100644 --- a/regamedll/dlls/util.cpp +++ b/regamedll/dlls/util.cpp @@ -1691,6 +1691,28 @@ bool UTIL_AreBotsAllowed() return false; } +bool UTIL_IsBeta() +{ +#ifdef BUILD_LATEST + if (g_engfuncs.pfnEngCheckParm == nullptr) + return false; + + // always beta from listen server + if (!IS_DEDICATED_SERVER()) + { + return true; + } + + int beta = ENG_CHECK_PARM("-beta", nullptr); + if (beta) + { + return true; + } +#endif // #ifdef BUILD_LATEST + + return false; +} + bool UTIL_AreHostagesImprov() { if (AreRunningCZero()) diff --git a/regamedll/dlls/util.h b/regamedll/dlls/util.h index e45b81125..af7a0a65e 100644 --- a/regamedll/dlls/util.h +++ b/regamedll/dlls/util.h @@ -294,6 +294,7 @@ bool UTIL_IsGame(const char *pszGameName); real_t UTIL_GetPlayerGaitYaw(int playerIndex); int UTIL_ReadFlags(const char *c); bool UTIL_AreBotsAllowed(); +bool UTIL_IsBeta(); bool UTIL_AreHostagesImprov(); int UTIL_GetNumPlayers(); bool UTIL_IsSpawnPointOccupied(CBaseEntity *pSpot); diff --git a/regamedll/regamedll/regamedll.cpp b/regamedll/regamedll/regamedll.cpp index 897653b4e..5e6190d15 100644 --- a/regamedll/regamedll/regamedll.cpp +++ b/regamedll/regamedll/regamedll.cpp @@ -30,8 +30,9 @@ void Regamedll_Game_Init() { - g_bIsCzeroGame = UTIL_IsGame("czero"); - g_bAllowedCSBot = UTIL_AreBotsAllowed(); // determine whether bots can be used or not + g_bIsBeta = UTIL_IsBeta(); + g_bIsCzeroGame = UTIL_IsGame("czero"); + g_bAllowedCSBot = UTIL_AreBotsAllowed(); // determine whether bots can be used or not g_bHostageImprov = UTIL_AreHostagesImprov(); // determine whether hostage improv can be used or not WeaponInfoReset(); diff --git a/regamedll/regamedll/regamedll.h b/regamedll/regamedll/regamedll.h index fedf81f8a..54c08d67d 100644 --- a/regamedll/regamedll/regamedll.h +++ b/regamedll/regamedll/regamedll.h @@ -34,3 +34,8 @@ inline bool AreRunningCZero() { return g_bIsCzeroGame; } + +inline bool AreRunningBeta() +{ + return g_bIsBeta; +} From 69e5c854e239253610257ed7b41027243931a139 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 05:45:27 +0700 Subject: [PATCH 05/15] Implemented cvar mp_infinite_grenades. Reworked cvar mp_infinite_ammo, not include grenades --- README.md | 1 + dist/game.cfg | 7 +++++++ regamedll/dlls/game.cpp | 2 ++ regamedll/dlls/game.h | 1 + regamedll/dlls/player.cpp | 2 ++ regamedll/dlls/weapons.cpp | 7 ++++++- regamedll/dlls/weapontype.cpp | 16 ++++++++++++++++ regamedll/dlls/weapontype.h | 1 + regamedll/public/regamedll/API/CSPlayer.h | 1 + 9 files changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 128420966..e7dd53058 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ therefore for this enter `-beta` option at the command line HLDS. | mp_auto_reload_weapons | 0 | 0 | 1 | Automatically reload each weapon on player spawn.
`0` disabled
`1` enabled | | mp_refill_bpammo_weapons | 0 | 0 | 2 | Refill amount of backpack ammo up to the max.
`0` disabled
`1` refill backpack ammo on player spawn
`2` refill backpack ammo on player spawn and on the purchase of the item | | mp_infinite_ammo | 0 | 0 | 2 | Sets the mode infinite ammo for weapons.
`0` disabled
`1` weapon clip infinite
`2` weapon bpammo infinite (This means for reloading) | +| mp_infinite_grenades | 0 | 0 | 1 | Enable infinite grenades.
`0` disabled
`1` grenades infinite | | mp_auto_join_team | 0 | 0 | 1 | Automatically joins the team.
`0` disabled
`1` enable (Use in conjunction with the cvar humans_join_team any/CT/T) | | mp_max_teamkills | 3 | 0 | - | Maximum number of allowed teamkills before autokick. Used when enabled mp_autokick. | | mp_fragsleft | - | - | - | Is the number of frags left, if you have set mp_fraglimit. You just type mp_fragsleft in server console, and it tells you the number of frags left depending of mp_fraglimit. | diff --git a/dist/game.cfg b/dist/game.cfg index f3a08b204..8014805cd 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -101,6 +101,13 @@ mp_refill_bpammo_weapons 0 // Default value: "0" mp_infinite_ammo 0 +// Enable infinite grenades +// 0 - disabled (default behaviour) +// 1 - grenades infinite +// +// Default value: "0" +mp_infinite_grenades 0 + // Automatically joins the team // 0 - disabled // 1 - enabled (Use in conjunction with the cvar humans_join_team any/SPEC/CT/T) diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 1ffbd8ff3..e959c7726 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -21,6 +21,7 @@ cvar_t timeleft = { "mp_timeleft", "0", FCVAR_SERVER | FCVAR_UNLOGG cvar_t friendlyfire = { "mp_friendlyfire", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t infiniteAmmo = { "mp_infinite_ammo", "0", FCVAR_SERVER, 0.0f, nullptr }; +cvar_t infiniteGrenades = { "mp_infinite_grenades", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t allowmonsters = { "mp_allowmonsters", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t roundtime = { "mp_roundtime", "5", FCVAR_SERVER, 0.0f, nullptr }; cvar_t buytime = { "mp_buytime", "1.5", FCVAR_SERVER, 0.0f, nullptr }; @@ -189,6 +190,7 @@ void EXT_FUNC GameDLLInit() #ifdef BUILD_LATEST CVAR_REGISTER(&infiniteAmmo); + CVAR_REGISTER(&infiniteGrenades); #endif CVAR_REGISTER(&flashlight); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 54015bfa9..f4ac37276 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -59,6 +59,7 @@ extern cvar_t fragsleft; extern cvar_t timeleft; extern cvar_t friendlyfire; extern cvar_t infiniteAmmo; +extern cvar_t infiniteGrenades; extern cvar_t allowmonsters; extern cvar_t roundtime; extern cvar_t buytime; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 7f5223165..2e01be1ff 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -6281,7 +6281,9 @@ void CBasePlayer::CheatImpulseCommands(int iImpulse) #ifdef REGAMEDLL_API CSPlayer()->m_iWeaponInfiniteAmmo = WPNMODE_INFINITE_BPAMMO; + CSPlayer()->m_iWeaponInfiniteIds = WEAPON_ALLWEAPONS; #endif + GiveNamedItemEx("item_longjump"); GiveNamedItemEx("item_thighpack"); GiveNamedItemEx("item_kevlar"); diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 799e39c72..86491a460 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -839,7 +839,12 @@ void CBasePlayerWeapon::HandleInfiniteAmmo() { m_iClip = iMaxClip(); } - else if (nInfiniteAmmo == WPNMODE_INFINITE_BPAMMO) + else if ((nInfiniteAmmo == WPNMODE_INFINITE_BPAMMO && +#ifdef REGAMEDLL_API + ((m_pPlayer->CSPlayer()->m_iWeaponInfiniteIds & (1 << m_iId)) || (m_pPlayer->CSPlayer()->m_iWeaponInfiniteIds <= 0 && !IsGrenadeWeapon(m_iId))) +#endif + ) + || (IsGrenadeWeapon(m_iId) && infiniteGrenades.value == 1.0f)) { if (pszAmmo1()) { diff --git a/regamedll/dlls/weapontype.cpp b/regamedll/dlls/weapontype.cpp index e59d46fbd..f677ee29d 100644 --- a/regamedll/dlls/weapontype.cpp +++ b/regamedll/dlls/weapontype.cpp @@ -439,6 +439,22 @@ bool IsSecondaryWeapon(int id) return false; } +// Return true if given weapon ID is a grenade +bool IsGrenadeWeapon(int id) +{ + switch (id) + { + case WEAPON_HEGRENADE: + case WEAPON_FLASHBANG: + case WEAPON_SMOKEGRENADE: + return true; + default: + break; + } + + return false; +} + WeaponInfoStruct *GetWeaponInfo(int weaponID) { for (auto& info : g_weaponInfo) { diff --git a/regamedll/dlls/weapontype.h b/regamedll/dlls/weapontype.h index 311faf4a4..390ca22a9 100644 --- a/regamedll/dlls/weapontype.h +++ b/regamedll/dlls/weapontype.h @@ -449,6 +449,7 @@ WeaponClassType AliasToWeaponClass(const char *alias); WeaponClassType WeaponIDToWeaponClass(int id); bool IsPrimaryWeapon(int id); bool IsSecondaryWeapon(int id); +bool IsGrenadeWeapon(int id); bool CanBuyWeaponByMaptype(int playerTeam, WeaponIdType weaponID, bool useAssasinationRestrictions); void WeaponInfoReset(); diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index d78e124dd..730921761 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -115,6 +115,7 @@ class CCSPlayer: public CCSMonster { float m_flSpawnProtectionEndTime; Vector m_vecOldvAngle; int m_iWeaponInfiniteAmmo; + int m_iWeaponInfiniteIds; }; // Inlines From 1f38db2778fe480015d5cf0b85a646e48cc64419 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 05:59:24 +0700 Subject: [PATCH 06/15] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7dd53058..4ac51fd01 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,13 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' Warning! ReGameDLL_CS is not binary compatible with original hlds since it's compiled with compilers other than ones used for original mod CS. This means that plugins that do binary code analysis (Orpheu for example) probably will not work with ReGameDLL_CS. ## How can use beta? -ReGameDLL_CS also have beta version with latest changes from official version of Counter-Strike, -therefore for this enter `-beta` option at the command line HLDS. +
ReGameDLL_CS also have beta version with latest changes from official version of Counter-Strike.
+* Enter `-beta` option at the command line HLDS. ## Configuration (cvars) +
+Click to expand + | CVar | Default | Min | Max | Description | | :--------------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- | | mp_freeforall | 0 | 0 | 1 | The style of gameplay where there aren't any teams (FFA mode)
`0` disabled
`1` enabled | @@ -71,6 +74,7 @@ therefore for this enter `-beta` option at the command line HLDS. | mp_radio_timeout | 1.5 | 0.0 | - | Delay between player Radio messages. (in seconds).
`0` disable delay | | mp_radio_maxinround | 60 | - | - | Maximum Radio messages count for player per round.
`0` disable radio messages | | mp_buy_anywhere | 0 | 0 | 3 | When set, players can buy anywhere, not only in buyzones.
`0` disabled.
`1` both teams
`2` only Terrorists team
`3` only CT team | +
## How to install zBot for CS 1.6? * Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true) From 1f84ae5d7b46cb5739ca36190a7cc44f0578da22 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 06:05:27 +0700 Subject: [PATCH 07/15] Unittest-win: Fixed demo failed #2 --- regamedll/dlls/animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index d61b9a3e3..2fb51853b 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -613,7 +613,7 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt) } float sclp, sclq; - float cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]); + real_t cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]); if ((1.0 + cosom) > 0.000001) { From 371ac897bb6d6e6b8a90c03b9453c356fc685095 Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 26 Aug 2019 15:29:22 +0700 Subject: [PATCH 08/15] Missing initialize for member m_iWeaponInfiniteIds --- regamedll/dlls/API/CSPlayer.cpp | 1 + regamedll/public/regamedll/API/CSPlayer.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 0cd10a9cd..c63b504b2 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -527,4 +527,5 @@ void CCSPlayer::Reset() m_vecOldvAngle = g_vecZero; m_iWeaponInfiniteAmmo = 0; + m_iWeaponInfiniteIds = 0; } diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 730921761..e615a2fe9 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -43,7 +43,8 @@ class CCSPlayer: public CCSMonster { m_bForceShowMenu(false), m_flRespawnPending(0), m_flSpawnProtectionEndTime(0), - m_iWeaponInfiniteAmmo(0) + m_iWeaponInfiniteAmmo(0), + m_iWeaponInfiniteIds(0) { m_szModel[0] = '\0'; } From 77305688a9d985b5f01ec2abf7f442f049d19796 Mon Sep 17 00:00:00 2001 From: fant1kua Date: Thu, 29 Aug 2019 16:34:22 +0300 Subject: [PATCH 09/15] Implement RG_CBasePlayer_UseEmpty hook (#405) * Implement to RG_CBasePlayer_UseEmpty --- gradle.properties | 2 +- regamedll/dlls/API/CAPI_Impl.cpp | 1 + regamedll/dlls/API/CAPI_Impl.h | 6 ++++++ regamedll/dlls/player.cpp | 12 +++++++++--- regamedll/dlls/player.h | 2 ++ regamedll/public/regamedll/API/CSPlayer.h | 2 +- regamedll/public/regamedll/regamedll_api.h | 7 ++++++- 7 files changed, 26 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 704a66e34..2c9a91828 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ majorVersion=5 -minorVersion=9 +minorVersion=10 maintenanceVersion=0 diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 0a464b06d..777454ec0 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -161,6 +161,7 @@ GAMEHOOK_REGISTRY(CBasePlayer_SetSpawnProtection); GAMEHOOK_REGISTRY(CBasePlayer_RemoveSpawnProtection); GAMEHOOK_REGISTRY(IsPenetrableEntity); GAMEHOOK_REGISTRY(CBasePlayer_HintMessageEx); +GAMEHOOK_REGISTRY(CBasePlayer_UseEmpty); int CReGameApi::GetMajorVersion() { return REGAMEDLL_API_VERSION_MAJOR; diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index a4f448043..ed5e51675 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -537,6 +537,10 @@ typedef IHookChainRegistryImpl typedef IHookChainClassImpl CReGameHook_CBasePlayer_HintMessageEx; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_HintMessageEx; +// CBasePlayer::UseEmpty hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_UseEmpty; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UseEmpty; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -645,6 +649,7 @@ class CReGameHookchains: public IReGameHookchains { CReGameHookRegistry_CBasePlayer_RemoveSpawnProtection m_CBasePlayer_RemoveSpawnProtection; CReGameHookRegistry_IsPenetrableEntity m_IsPenetrableEntity; CReGameHookRegistry_CBasePlayer_HintMessageEx m_CBasePlayer_HintMessageEx; + CReGameHookRegistry_CBasePlayer_UseEmpty m_CBasePlayer_UseEmpty; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -752,6 +757,7 @@ class CReGameHookchains: public IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection *CBasePlayer_RemoveSpawnProtection(); virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity(); virtual IReGameHookRegistry_CBasePlayer_HintMessageEx *CBasePlayer_HintMessageEx(); + virtual IReGameHookRegistry_CBasePlayer_UseEmpty *CBasePlayer_UseEmpty(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 2e01be1ff..62069390c 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -3922,13 +3922,19 @@ void CBasePlayer::PlayerUse() } } } - else + else if (m_afButtonPressed & IN_USE) { - if (m_afButtonPressed & IN_USE) - EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_denyselect.wav", 0.4, ATTN_NORM); + UseEmpty(); } } +LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, UseEmpty) + +void EXT_FUNC CBasePlayer::__API_HOOK(UseEmpty)() +{ + EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_denyselect.wav", 0.4, ATTN_NORM); +} + void CBasePlayer::HostageUsed() { if (m_flDisplayHistory & DHF_HOSTAGE_USED) diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 8b5b0a97e..88b475856 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -424,6 +424,7 @@ class CBasePlayer: public CBaseMonster { void SetSpawnProtection_OrigFunc(float flProtectionTime); void RemoveSpawnProtection_OrigFunc(); bool HintMessageEx_OrigFunc(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false); + void UseEmpty_OrigFunc(); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API @@ -619,6 +620,7 @@ class CBasePlayer: public CBaseMonster { void SetSpawnProtection(float flProtectionTime); void RemoveSpawnProtection(); + void UseEmpty(); // templates template diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index e615a2fe9..5483907a0 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -91,7 +91,7 @@ class CCSPlayer: public CCSMonster { virtual void ResetSequenceInfo(); virtual void StartDeathCam(); virtual bool RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo); - virtual void SetSpawnProtection(float flProtectionTime); + virtual void SetSpawnProtection(float flProtectionTime); virtual void RemoveSpawnProtection(); virtual bool HintMessageEx(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index cd258ab31..2616ef84f 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 9 +#define REGAMEDLL_API_VERSION_MINOR 10 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -440,6 +440,10 @@ typedef IHookChainRegistry IRe typedef IHookChainClass IReGameHook_CBasePlayer_HintMessageEx; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HintMessageEx; +// CBasePlayer::UseEmpty hook +typedef IHookChainClass IReGameHook_CBasePlayer_UseEmpty; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UseEmpty; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -549,6 +553,7 @@ class IReGameHookchains { virtual IReGameHookRegistry_CBasePlayer_SetSpawnProtection *CBasePlayer_SetSpawnProtection() = 0; virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity() = 0; virtual IReGameHookRegistry_CBasePlayer_HintMessageEx *CBasePlayer_HintMessageEx() = 0; + virtual IReGameHookRegistry_CBasePlayer_UseEmpty *CBasePlayer_UseEmpty() = 0; }; struct ReGameFuncs_t { From 80e8730187ae03652ab1c6ed5c9f0d990f28c0ac Mon Sep 17 00:00:00 2001 From: fl0werD Date: Thu, 29 Aug 2019 17:51:41 +0400 Subject: [PATCH 10/15] Add force visibility effect (#406) * Add force visibility effect --- regamedll/common/const.h | 23 ++++++++++++----------- regamedll/dlls/client.cpp | 22 +++++++++++++++------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/regamedll/common/const.h b/regamedll/common/const.h index f3c9b8dcc..c12e3769e 100644 --- a/regamedll/common/const.h +++ b/regamedll/common/const.h @@ -130,17 +130,18 @@ #define DAMAGE_AIM 2 // entity effects -#define EF_BRIGHTFIELD 1 // swirling cloud of particles -#define EF_MUZZLEFLASH 2 // single frame ELIGHT on entity attachment 0 -#define EF_BRIGHTLIGHT 4 // DLIGHT centered at entity origin -#define EF_DIMLIGHT 8 // player flashlight -#define EF_INVLIGHT 16 // get lighting from ceiling -#define EF_NOINTERP 32 // don't interpolate the next frame -#define EF_LIGHT 64 // rocket flare glow sprite -#define EF_NODRAW 128 // don't draw entity -#define EF_NIGHTVISION 256 // player nightvision -#define EF_SNIPERLASER 512 // sniper laser effect -#define EF_FIBERCAMERA 1024 // fiber camera +#define EF_BRIGHTFIELD (1<<0) // swirling cloud of particles +#define EF_MUZZLEFLASH (1<<1) // single frame ELIGHT on entity attachment 0 +#define EF_BRIGHTLIGHT (1<<2) // DLIGHT centered at entity origin +#define EF_DIMLIGHT (1<<3) // player flashlight +#define EF_INVLIGHT (1<<4) // get lighting from ceiling +#define EF_NOINTERP (1<<5) // don't interpolate the next frame +#define EF_LIGHT (1<<6) // rocket flare glow sprite +#define EF_NODRAW (1<<7) // don't draw entity +#define EF_NIGHTVISION (1<<8) // player nightvision +#define EF_SNIPERLASER (1<<9) // sniper laser effect +#define EF_FIBERCAMERA (1<<10) // fiber camera +#define EF_FORCEVISIBILITY (1<<11) // force visibility // entity flags #define EFLAG_SLERP 1 // do studio interpolation of this entity diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 204e6081a..9b65b8588 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -4300,17 +4300,22 @@ BOOL EXT_FUNC AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, e if (CheckPlayerPVSLeafChanged(host, hostnum)) ResetPlayerPVS(host, hostnum); - if (ent != host) +#ifdef REGAMEDLL_ADD + if ((ent->v.effects & EF_FORCEVISIBILITY) != EF_FORCEVISIBILITY) +#endif { - if (!CheckEntityRecentlyInPVS(hostnum, e, gpGlobals->time)) + if (ent != host) { - if (!ENGINE_CHECK_VISIBILITY(ent, pSet)) + if (!CheckEntityRecentlyInPVS(hostnum, e, gpGlobals->time)) { - MarkEntityInPVS(hostnum, e, 0, false); - return FALSE; - } + if (!ENGINE_CHECK_VISIBILITY(ent, pSet)) + { + MarkEntityInPVS(hostnum, e, 0, false); + return FALSE; + } - MarkEntityInPVS(hostnum, e, gpGlobals->time, true); + MarkEntityInPVS(hostnum, e, gpGlobals->time, true); + } } } @@ -4363,6 +4368,9 @@ BOOL EXT_FUNC AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, e state->effects = ent->v.effects; #ifdef REGAMEDLL_ADD + // don't send unhandled custom bit to client + state->effects &= ~EF_FORCEVISIBILITY; + if (ent->v.skin == CONTENTS_LADDER && (host->v.iuser3 & PLAYER_PREVENT_CLIMB) == PLAYER_PREVENT_CLIMB) { state->skin = CONTENTS_EMPTY; From 2fcba6f35a0418224067a191bf2700758c608637 Mon Sep 17 00:00:00 2001 From: justgo97 Date: Thu, 29 Aug 2019 15:57:12 +0200 Subject: [PATCH 11/15] Disconnected players func_tank fix (#400) for more info visit this thread : https://forums.alliedmods.net/showthread.php?t=317763 --- regamedll/dlls/player.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 62069390c..315c7b13f 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1496,6 +1496,14 @@ void CBasePlayer::RemoveAllItems(BOOL removeSuit) bool bKillProgBar = false; int i; +#ifdef REGAMEDLL_FIXES + if (m_pTank) + { + m_pTank->Use(this, this, USE_OFF, 0); + m_pTank = nullptr; + } +#endif + if (m_bHasDefuser) { RemoveDefuser(); From 69250cf2c1058334c848d9896314a4a98d3bc1d5 Mon Sep 17 00:00:00 2001 From: s1lent Date: Thu, 29 Aug 2019 22:31:33 +0700 Subject: [PATCH 12/15] AddToFullPack: Added more extra effect flags EF_OWNER_VISIBILITY/EF_OWNER_NO_VISIBILITY --- regamedll/common/const.h | 2 ++ regamedll/dlls/client.cpp | 23 +++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/regamedll/common/const.h b/regamedll/common/const.h index c12e3769e..e380bb671 100644 --- a/regamedll/common/const.h +++ b/regamedll/common/const.h @@ -142,6 +142,8 @@ #define EF_SNIPERLASER (1<<9) // sniper laser effect #define EF_FIBERCAMERA (1<<10) // fiber camera #define EF_FORCEVISIBILITY (1<<11) // force visibility +#define EF_OWNER_VISIBILITY (1<<12) // visibility for owner +#define EF_OWNER_NO_VISIBILITY (1<<13) // no visibility for owner // entity flags #define EFLAG_SLERP 1 // do studio interpolation of this entity diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 9b65b8588..c39fdabe7 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -4286,8 +4286,23 @@ bool CheckEntityRecentlyInPVS(int clientnum, int entitynum, float currenttime) BOOL EXT_FUNC AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, BOOL player, unsigned char *pSet) { - if ((ent->v.effects & EF_NODRAW) == EF_NODRAW && ent != host) - return FALSE; + if (ent != host) + { + if ((ent->v.effects & EF_NODRAW) == EF_NODRAW) + return FALSE; + +#ifdef REGAMEDLL_ADD + if (ent->v.owner == host) + { + // the owner can't see this entity + if ((ent->v.effects & EF_OWNER_NO_VISIBILITY) == EF_OWNER_NO_VISIBILITY) + return FALSE; + } + // no one can't see this entity except the owner + else if ((ent->v.effects & EF_OWNER_VISIBILITY) == EF_OWNER_VISIBILITY) + return FALSE; +#endif + } if (!ent->v.modelindex || !STRING(ent->v.model)) return FALSE; @@ -4368,8 +4383,8 @@ BOOL EXT_FUNC AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, e state->effects = ent->v.effects; #ifdef REGAMEDLL_ADD - // don't send unhandled custom bit to client - state->effects &= ~EF_FORCEVISIBILITY; + // don't send unhandled custom bits to client + state->effects &= ~(EF_FORCEVISIBILITY | EF_OWNER_VISIBILITY | EF_OWNER_NO_VISIBILITY); if (ent->v.skin == CONTENTS_LADDER && (host->v.iuser3 & PLAYER_PREVENT_CLIMB) == PLAYER_PREVENT_CLIMB) { From 96938aec5587ab0e93cd3fe8bba0352553cf051c Mon Sep 17 00:00:00 2001 From: s1lent Date: Thu, 29 Aug 2019 23:08:24 +0700 Subject: [PATCH 13/15] ReGameDLL API: Implement BGetICSEntity/BGetIGameRules for check safe version interface. --- regamedll/dlls/API/CAPI_Impl.cpp | 20 ++++++++++++++++++++ regamedll/dlls/API/CAPI_Impl.h | 2 ++ regamedll/dlls/gamerules.h | 2 ++ regamedll/public/regamedll/API/CSEntity.h | 7 +++++++ regamedll/public/regamedll/regamedll_api.h | 4 +++- 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 777454ec0..17ddcb35c 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -204,6 +204,26 @@ AmmoInfo *CReGameApi::GetAmmoInfo(AmmoType ammoID) { return &CBasePlayerItem::m_ AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(AmmoType ammoID) { return ::GetAmmoInfo(ammoID); } AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(const char *ammoName) { return ::GetAmmoInfo(ammoName); } +bool CReGameApi::BGetICSEntity(const char *pchVersion) const +{ + if (!Q_stricmp(pchVersion, CSENTITY_API_INTERFACE_VERSION)) + { + return true; + } + + return false; +} + +bool CReGameApi::BGetIGameRules(const char *pchVersion) const +{ + if (!Q_stricmp(pchVersion, GAMERULES_API_INTERFACE_VERSION)) + { + return true; + } + + return false; +} + EXT_FUNC void Regamedll_ChangeString_api(char *&dest, const char *source) { size_t len = Q_strlen(source); diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index ed5e51675..3e8b6a554 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -781,6 +781,8 @@ class CReGameApi: public IReGameApi { EXT_FUNC virtual AmmoInfo *GetAmmoInfo(AmmoType ammoID); EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID); EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName); + EXT_FUNC virtual bool BGetICSEntity(const char *pchVersion) const; + EXT_FUNC virtual bool BGetIGameRules(const char *pchVersion) const; }; void Regamedll_ChangeString_api(char *&dest, const char *source); diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index aa3ee75bc..548dd08f2 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -337,6 +337,8 @@ class CGameRules bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver) }; +#define GAMERULES_API_INTERFACE_VERSION "GAMERULES_API_INTERFACE_VERSION001" + // CHalfLifeRules - rules for the single player Half-Life game. class CHalfLifeRules: public CGameRules { diff --git a/regamedll/public/regamedll/API/CSEntity.h b/regamedll/public/regamedll/API/CSEntity.h index ef47f30fb..2c69f232f 100644 --- a/regamedll/public/regamedll/API/CSEntity.h +++ b/regamedll/public/regamedll/API/CSEntity.h @@ -32,6 +32,11 @@ class CBaseEntity; class CCSEntity { public: + CCSEntity() : + m_pContainingEntity(nullptr) + { + } + 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); @@ -63,3 +68,5 @@ class CCSMonster: public CCSToggle public: }; + +#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION001" diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 2616ef84f..200414682 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 10 +#define REGAMEDLL_API_VERSION_MINOR 11 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -589,6 +589,8 @@ class IReGameApi { virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0; virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0; virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0; + virtual bool BGetICSEntity(const char *pchVersion) const = 0; + virtual bool BGetIGameRules(const char *pchVersion) const = 0; }; #define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001" From 1c2aa38cc3737e0eac1008844eb33a41836b04d7 Mon Sep 17 00:00:00 2001 From: s1lent Date: Fri, 30 Aug 2019 00:45:25 +0700 Subject: [PATCH 14/15] Update const.h and sdk --- regamedll/common/const.h | 912 +++++++++++++++++++++++---------- regamedll/common/winsani_in.h | 7 + regamedll/common/winsani_out.h | 4 + regamedll/dlls/extdll.h | 8 +- regamedll/engine/maintypes.h | 22 +- 5 files changed, 682 insertions(+), 271 deletions(-) create mode 100644 regamedll/common/winsani_in.h create mode 100644 regamedll/common/winsani_out.h diff --git a/regamedll/common/const.h b/regamedll/common/const.h index e380bb671..323f5ab0a 100644 --- a/regamedll/common/const.h +++ b/regamedll/common/const.h @@ -32,298 +32,676 @@ #pragma once #endif -// buttons -#include "in_buttons.h" - // Max # of clients allowed in a server. -#define MAX_CLIENTS 32 +#define MAX_CLIENTS 32 // How many bits to use to encode an edict. -#define MAX_EDICT_BITS 11 // # of bits needed to represent max edicts +#define MAX_EDICT_BITS 11 // # of bits needed to represent max edicts + // Max # of edicts in a level (2048) -#define MAX_EDICTS (1<flags -#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground -#define FL_SWIM (1<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) -#define FL_CONVEYOR (1<<2) -#define FL_CLIENT (1<<3) -#define FL_INWATER (1<<4) -#define FL_MONSTER (1<<5) -#define FL_GODMODE (1<<6) -#define FL_NOTARGET (1<<7) -#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself -#define FL_ONGROUND (1<<9) // At rest / on the ground -#define FL_PARTIALGROUND (1<<10) // not all corners are valid -#define FL_WATERJUMP (1<<11) // player jumping out of water -#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera -#define FL_FAKECLIENT (1<<13) // JAC: fake client, simulated server side; don't send network messages to them -#define FL_DUCKING (1<<14) // Player flag -- Player is fully crouched -#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water -#define FL_GRAPHED (1<<16) // worldgraph has this ent listed as something that blocks a connection - -#define FL_IMMUNE_WATER (1<<17) -#define FL_IMMUNE_SLIME (1<<18) -#define FL_IMMUNE_LAVA (1<<19) - -#define FL_PROXY (1<<20) // This is a spectator proxy -#define FL_ALWAYSTHINK (1<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path) -#define FL_BASEVELOCITY (1<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum) -#define FL_MONSTERCLIP (1<<23) // Only collide in with monsters who have FL_MONSTERCLIP set -#define FL_ONTRAIN (1<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. -#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) -#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc. -#define FL_CUSTOMENTITY (1<<29) // This is a custom entity -#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time -#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client +#define FL_FLY BIT(0) // Changes the SV_Movestep() behavior to not need to be on ground +#define FL_SWIM BIT(1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) +#define FL_CONVEYOR BIT(2) +#define FL_CLIENT BIT(3) +#define FL_INWATER BIT(4) +#define FL_MONSTER BIT(5) +#define FL_GODMODE BIT(6) +#define FL_NOTARGET BIT(7) +#define FL_SKIPLOCALHOST BIT(8) // Don't send entity to local host, it's predicting this entity itself +#define FL_ONGROUND BIT(9) // At rest / on the ground +#define FL_PARTIALGROUND BIT(10) // not all corners are valid +#define FL_WATERJUMP BIT(11) // player jumping out of water +#define FL_FROZEN BIT(12) // Player is frozen for 3rd person camera +#define FL_FAKECLIENT BIT(13) // JAC: fake client, simulated server side; don't send network messages to them +#define FL_DUCKING BIT(14) // Player flag -- Player is fully crouched +#define FL_FLOAT BIT(15) // Apply floating force to this entity when in water +#define FL_GRAPHED BIT(16) // worldgraph has this ent listed as something that blocks a connection + +// UNDONE: Do we need these? +#define FL_IMMUNE_WATER BIT(17) +#define FL_IMMUNE_SLIME BIT(18) +#define FL_IMMUNE_LAVA BIT(19) + +#define FL_PROXY BIT(20) // This is a spectator proxy +#define FL_ALWAYSTHINK BIT(21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path) +#define FL_BASEVELOCITY BIT(22) // Base velocity has been applied this frame (used to convert base velocity into momentum) +#define FL_MONSTERCLIP BIT(23) // Only collide in with monsters who have FL_MONSTERCLIP set +#define FL_ONTRAIN BIT(24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. +#define FL_WORLDBRUSH BIT(25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) +#define FL_SPECTATOR BIT(26) // This client is a spectator, don't run touch functions, etc. +#define FL_CUSTOMENTITY BIT(29) // This is a custom entity +#define FL_KILLME BIT(30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time +#define FL_DORMANT BIT(31) // Entity is dormant, no updates to client + +// SV_EmitSound2 flags +#define SND_EMIT2_NOPAS BIT(0) // never to do check PAS +#define SND_EMIT2_INVOKER BIT(1) // do not send to the client invoker // Engine edict->spawnflags -#define SF_NOTINDEATHMATCH 0x0800 // Do not spawn when deathmatch and loading entities from a file +#define SF_NOTINDEATHMATCH BIT(11) // Do not spawn when deathmatch and loading entities from a file // Goes into globalvars_t.trace_flags -#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box +#define FTRACE_SIMPLEBOX BIT(0) // Traceline with a simple box // walkmove modes -#define WALKMOVE_NORMAL 0 // normal walkmove -#define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type -#define WALKMOVE_CHECKONLY 2 // move, but don't touch triggers - -#define MOVETYPE_NONE 0 // never moves -//#define MOVETYPE_ANGLENOCLIP 1 -//#define MOVETYPE_ANGLECLIP 2 -#define MOVETYPE_WALK 3 // Player only - moving on the ground -#define MOVETYPE_STEP 4 // gravity, special edge handling -- monsters use this -#define MOVETYPE_FLY 5 // No gravity, but still collides with stuff -#define MOVETYPE_TOSS 6 // gravity/collisions -#define MOVETYPE_PUSH 7 // no clip to world, push and crush -#define MOVETYPE_NOCLIP 8 // No gravity, no collisions, still do velocity/avelocity -#define MOVETYPE_FLYMISSILE 9 // extra size to monsters -#define MOVETYPE_BOUNCE 10 // Just like Toss, but reflect velocity when contacting surfaces -#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity -#define MOVETYPE_FOLLOW 12 // track movement of aiment -#define MOVETYPE_PUSHSTEP 13 // BSP model that needs physics/world collisions (uses nearest hull for world collision) - -#define SOLID_NOT 0 // no interaction with other objects -#define SOLID_TRIGGER 1 // touch on edge, but not blocking -#define SOLID_BBOX 2 // touch on edge, block -#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground -#define SOLID_BSP 4 // bsp clip, touch on edge, block - -// deadflag values -#define DEAD_NO 0 // alive -#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground -#define DEAD_DEAD 2 // dead. lying still. -#define DEAD_RESPAWNABLE 3 // do respawn the entity -#define DEAD_DISCARDBODY 4 - -#define DAMAGE_NO 0 -#define DAMAGE_YES 1 -#define DAMAGE_AIM 2 - -// entity effects -#define EF_BRIGHTFIELD (1<<0) // swirling cloud of particles -#define EF_MUZZLEFLASH (1<<1) // single frame ELIGHT on entity attachment 0 -#define EF_BRIGHTLIGHT (1<<2) // DLIGHT centered at entity origin -#define EF_DIMLIGHT (1<<3) // player flashlight -#define EF_INVLIGHT (1<<4) // get lighting from ceiling -#define EF_NOINTERP (1<<5) // don't interpolate the next frame -#define EF_LIGHT (1<<6) // rocket flare glow sprite -#define EF_NODRAW (1<<7) // don't draw entity -#define EF_NIGHTVISION (1<<8) // player nightvision -#define EF_SNIPERLASER (1<<9) // sniper laser effect -#define EF_FIBERCAMERA (1<<10) // fiber camera -#define EF_FORCEVISIBILITY (1<<11) // force visibility -#define EF_OWNER_VISIBILITY (1<<12) // visibility for owner -#define EF_OWNER_NO_VISIBILITY (1<<13) // no visibility for owner - -// entity flags -#define EFLAG_SLERP 1 // do studio interpolation of this entity - -#define TE_BEAMPOINTS 0 // beam effect between two points -#define TE_BEAMENTPOINT 1 // beam effect between point and entity -#define TE_GUNSHOT 2 // particle effect plus ricochet sound - -#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps - -#define TE_EXPLFLAG_NONE 0 // all flags clear makes default Half-Life explosion -#define TE_EXPLFLAG_NOADDITIVE 1 // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) -#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights -#define TE_EXPLFLAG_NOSOUND 4 // do not play client explosion sound -#define TE_EXPLFLAG_NOPARTICLES 8 // do not draw particles - -#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound -#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps -#define TE_TRACER 6 // tracer effect from point to point -#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters -#define TE_BEAMENTS 8 -#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite -#define TE_LAVASPLASH 10 // Quake1 lava splash -#define TE_TELEPORT 11 // Quake1 teleport splash -#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound -#define TE_BSPDECAL 13 // Decal from the .BSP file -#define TE_IMPLOSION 14 // tracers moving toward a point -#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions -#define TE_BEAM 16 // obsolete -#define TE_SPRITE 17 // additive sprite, plays 1 cycle -#define TE_BEAMSPRITE 18 // A beam with a sprite at the end -#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime -#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime -#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime -#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving -#define TE_GLOWSPRITE 23 -#define TE_BEAMRING 24 // connect a beam ring to two entities -#define TE_STREAK_SPLASH 25 // oriented shower of tracers -#define TE_BEAMHOSE 26 // obsolete -#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect -#define TE_ELIGHT 28 // point entity light, no world effect -#define TE_TEXTMESSAGE 29 -#define TE_LINE 30 -#define TE_BOX 31 -#define TE_KILLBEAM 99 // kill all beams attached to entity -#define TE_LARGEFUNNEL 100 -#define TE_BLOODSTREAM 101 // particle spray -#define TE_SHOWLINE 102 // line of particles every 5 units, dies in 30 seconds -#define TE_BLOOD 103 // particle spray -#define TE_DECAL 104 // Decal applied to a brush entity (not the world) -#define TE_FIZZ 105 // create alpha sprites inside of entity, float upwards -#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits -#define TE_EXPLODEMODEL 107 // spherical shower of models, picks from set -#define TE_BREAKMODEL 108 // box of models or sprites -#define TE_GUNSHOTDECAL 109 // decal and ricochet sound -#define TE_SPRITE_SPRAY 110 // spay of alpha sprites -#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound. -#define TE_PLAYERDECAL 112 // ??? -#define TE_BUBBLES 113 // create alpha sprites inside of box, float upwards -#define TE_BUBBLETRAIL 114 // create alpha sprites along a line, float upwards -#define TE_BLOODSPRITE 115 // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent) -#define TE_WORLDDECAL 116 // Decal applied to the world brush -#define TE_WORLDDECALHIGH 117 // Decal (with texture index > 256) applied to world brush -#define TE_DECALHIGH 118 // Same as TE_DECAL, but the texture index was greater than 256 -#define TE_PROJECTILE 119 // Makes a projectile (like a nail) (this is a high-priority tent) -#define TE_SPRAY 120 // Throws a shower of sprites or models -#define TE_PLAYERSPRITES 121 // sprites emit from a player's bounding box (ONLY use for players!) -#define TE_PARTICLEBURST 122 // very similar to lavasplash. - -#define TE_FIREFIELD 123 // makes a field of fire. - +#define WALKMOVE_NORMAL 0 // normal walkmove +#define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type +#define WALKMOVE_CHECKONLY 2 // move, but don't touch triggers + +// edict->movetype values +#define MOVETYPE_NONE 0 // never moves +//#define MOVETYPE_ANGLENOCLIP 1 +//#define MOVETYPE_ANGLECLIP 2 +#define MOVETYPE_WALK 3 // Player only - moving on the ground +#define MOVETYPE_STEP 4 // gravity, special edge handling -- monsters use this +#define MOVETYPE_FLY 5 // No gravity, but still collides with stuff +#define MOVETYPE_TOSS 6 // gravity/collisions +#define MOVETYPE_PUSH 7 // no clip to world, push and crush +#define MOVETYPE_NOCLIP 8 // No gravity, no collisions, still do velocity/avelocity +#define MOVETYPE_FLYMISSILE 9 // extra size to monsters +#define MOVETYPE_BOUNCE 10 // Just like Toss, but reflect velocity when contacting surfaces +#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity +#define MOVETYPE_FOLLOW 12 // track movement of aiment +#define MOVETYPE_PUSHSTEP 13 // BSP model that needs physics/world collisions (uses nearest hull for world collision) + +// edict->solid values +// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves +// SOLID only effects OTHER entities colliding with this one when they move - UGH! +#define SOLID_NOT 0 // no interaction with other objects +#define SOLID_TRIGGER 1 // touch on edge, but not blocking +#define SOLID_BBOX 2 // touch on edge, block +#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground +#define SOLID_BSP 4 // bsp clip, touch on edge, block + +// edict->deadflag values +#define DEAD_NO 0 // alive +#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground +#define DEAD_DEAD 2 // dead. lying still. +#define DEAD_RESPAWNABLE 3 // do respawn the entity +#define DEAD_DISCARDBODY 4 + +#define DAMAGE_NO 0 +#define DAMAGE_YES 1 +#define DAMAGE_AIM 2 + +// edict->effects values +#define EF_BRIGHTFIELD BIT(0) // swirling cloud of particles +#define EF_MUZZLEFLASH BIT(1) // single frame ELIGHT on entity attachment 0 +#define EF_BRIGHTLIGHT BIT(2) // DLIGHT centered at entity origin +#define EF_DIMLIGHT BIT(3) // player flashlight +#define EF_INVLIGHT BIT(4) // get lighting from ceiling +#define EF_NOINTERP BIT(5) // don't interpolate the next frame +#define EF_LIGHT BIT(6) // rocket flare glow sprite +#define EF_NODRAW BIT(7) // don't draw entity +#define EF_NIGHTVISION BIT(8) // player nightvision +#define EF_SNIPERLASER BIT(9) // sniper laser effect +#define EF_FIBERCAMERA BIT(10) // fiber camera +#define EF_FORCEVISIBILITY BIT(11) // force visibility +#define EF_OWNER_VISIBILITY BIT(12) // visibility for owner +#define EF_OWNER_NO_VISIBILITY BIT(13) // no visibility for owner + +// state->eflags values +#define EFLAG_SLERP 1 // do studio interpolation of this entity + +// +// temp entity events +// +#define TE_BEAMPOINTS 0 // beam effect between two points +// coord coord coord (start position) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMENTPOINT 1 // beam effect between point and entity +// short (start entity) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_GUNSHOT 2 // particle effect plus ricochet sound +// coord coord coord (position) + +#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps +// coord coord coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (framerate) +// byte (flags) +// +// The Explosion effect has some flags to control performance/aesthetic features: +#define TE_EXPLFLAG_NONE 0 // all flags clear makes default Half-Life explosion +#define TE_EXPLFLAG_NOADDITIVE 1 // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) +#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights +#define TE_EXPLFLAG_NOSOUND 4 // do not play client explosion sound +#define TE_EXPLFLAG_NOPARTICLES 8 // do not draw particles + +#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound +// coord coord coord (position) + +#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps +// coord coord coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (framerate) + +#define TE_TRACER 6 // tracer effect from point to point +// coord, coord, coord (start) +// coord, coord, coord (end) + +#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters +// coord, coord, coord (start) +// coord, coord, coord (end) +// byte (life in 0.1's) +// byte (width in 0.1's) +// byte (amplitude in 0.01's) +// short (sprite model index) + +#define TE_BEAMENTS 8 +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite +// coord coord coord (position) + +#define TE_LAVASPLASH 10 // Quake1 lava splash +// coord coord coord (position) + +#define TE_TELEPORT 11 // Quake1 teleport splash +// coord coord coord (position) + +#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound +// coord coord coord (position) +// byte (starting color) +// byte (num colors) + +#define TE_BSPDECAL 13 // Decal from the .BSP file +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// short (texture index of precached decal texture name) +// short (entity index) +// [optional - only included if previous short is non-zero (not the world)] short (index of model of above entity) + +#define TE_IMPLOSION 14 // tracers moving toward a point +// coord, coord, coord (position) +// byte (radius) +// byte (count) +// byte (life in 0.1's) + +#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions +// coord, coord, coord (start) +// coord, coord, coord (end) +// short (sprite index) +// byte (count) +// byte (life in 0.1's) +// byte (scale in 0.1's) +// byte (velocity along vector in 10's) +// byte (randomness of velocity in 10's) + +#define TE_BEAM 16 // obsolete + +#define TE_SPRITE 17 // additive sprite, plays 1 cycle +// coord, coord, coord (position) +// short (sprite index) +// byte (scale in 0.1's) +// byte (brightness) + +#define TE_BEAMSPRITE 18 // A beam with a sprite at the end +// coord, coord, coord (start position) +// coord, coord, coord (end position) +// short (beam sprite index) +// short (end sprite index) + +#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving +// short (entity:attachment to follow) +// short (sprite index) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte,byte,byte (color) +// byte (brightness) + +#define TE_GLOWSPRITE 23 +// coord, coord, coord (pos) short (model index) byte (scale / 10) + +#define TE_BEAMRING 24 // connect a beam ring to two entities +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) +// byte,byte,byte (color) +// byte (brightness) +// byte (scroll speed in 0.1's) + +#define TE_STREAK_SPLASH 25 // oriented shower of tracers +// coord coord coord (start position) +// coord coord coord (direction vector) +// byte (color) +// short (count) +// short (base speed) +// short (ramdon velocity) + +#define TE_BEAMHOSE 26 // obsolete + +#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect +// coord, coord, coord (pos) +// byte (radius in 10's) +// byte byte byte (color) +// byte (brightness) +// byte (life in 10's) +// byte (decay rate in 10's) + +#define TE_ELIGHT 28 // point entity light, no world effect +// short (entity:attachment to follow) +// coord coord coord (initial position) +// coord (radius) +// byte byte byte (color) +// byte (life in 0.1's) +// coord (decay rate) + +#define TE_TEXTMESSAGE 29 +// short 1.2.13 x (-1 = center) +// short 1.2.13 y (-1 = center) +// byte Effect 0 = fade in/fade out +// 1 is flickery credits +// 2 is write out (training room) + +// 4 bytes r,g,b,a color1 (text color) +// 4 bytes r,g,b,a color2 (effect color) +// ushort 8.8 fadein time +// ushort 8.8 fadeout time +// ushort 8.8 hold time +// optional ushort 8.8 fxtime (time the highlight lags behing the leading text in effect 2) +// string text message (512 chars max sz string) +#define TE_LINE 30 +// coord, coord, coord (startpos) +// coord, coord, coord (endpos) +// short life in 0.1 s +// 3 bytes r, g, b + +#define TE_BOX 31 +// coord, coord, coord (boxmins) +// coord, coord, coord (boxmaxs) +// short life in 0.1 s +// 3 bytes r, g, b + +#define TE_KILLBEAM 99 // kill all beams attached to entity +// short (entity) + +#define TE_LARGEFUNNEL 100 +// coord coord coord (funnel position) +// short (sprite index) +// short (flags) + +#define TE_BLOODSTREAM 101 // particle spray +// coord coord coord (start position) +// coord coord coord (spray vector) +// byte (color) +// byte (speed) + +#define TE_SHOWLINE 102 // line of particles every 5 units, dies in 30 seconds +// coord coord coord (start position) +// coord coord coord (end position) + +#define TE_BLOOD 103 // particle spray +// coord coord coord (start position) +// coord coord coord (spray vector) +// byte (color) +// byte (speed) + +#define TE_DECAL 104 // Decal applied to a brush entity (not the world) +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name) +// short (entity index) + +#define TE_FIZZ 105 // create alpha sprites inside of entity, float upwards +// short (entity) +// short (sprite index) +// byte (density) + +#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// angle (initial yaw) +// short (model index) +// byte (bounce sound type) +// byte (life in 0.1's) + +#define TE_EXPLODEMODEL 107 // spherical shower of models, picks from set +// coord, coord, coord (origin) +// coord (velocity) +// short (model index) +// short (count) +// byte (life in 0.1's) + +#define TE_BREAKMODEL 108 // box of models or sprites +// coord, coord, coord (position) +// coord, coord, coord (size) +// coord, coord, coord (velocity) +// byte (random velocity in 10's) +// short (sprite or model index) +// byte (count) +// byte (life in 0.1 secs) +// byte (flags) + +#define TE_GUNSHOTDECAL 109 // decal and ricochet sound +// coord, coord, coord (position) +// short (entity index???) +// byte (decal???) + +#define TE_SPRITE_SPRAY 110 // spay of alpha sprites +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// short (sprite index) +// byte (count) +// byte (speed) +// byte (noise) + +#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound. +// coord, coord, coord (position) +// byte (scale in 0.1's) + +#define TE_PLAYERDECAL 112 // ??? +// byte (playerindex) +// coord, coord, coord (position) +// short (entity???) +// byte (decal number???) +// [optional] short (model index???) + +#define TE_BUBBLES 113 // create alpha sprites inside of box, float upwards +// coord, coord, coord (min start position) +// coord, coord, coord (max start position) +// coord (float height) +// short (model index) +// byte (count) +// coord (speed) + +#define TE_BUBBLETRAIL 114 // create alpha sprites along a line, float upwards +// coord, coord, coord (min start position) +// coord, coord, coord (max start position) +// coord (float height) +// short (model index) +// byte (count) +// coord (speed) + +#define TE_BLOODSPRITE 115 // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent) +// coord, coord, coord (position) +// short (sprite1 index) +// short (sprite2 index) +// byte (color) +// byte (scale) + +#define TE_WORLDDECAL 116 // Decal applied to the world brush +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name) + +#define TE_WORLDDECALHIGH 117 // Decal (with texture index > 256) applied to world brush +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name - 256) + +#define TE_DECALHIGH 118 // Same as TE_DECAL, but the texture index was greater than 256 +// coord, coord, coord (x,y,z), decal position (center of texture in world) +// byte (texture index of precached decal texture name - 256) +// short (entity index) + +#define TE_PROJECTILE 119 // Makes a projectile (like a nail) (this is a high-priority tent) +// coord, coord, coord (position) +// coord, coord, coord (velocity) +// short (modelindex) +// byte (life) +// byte (owner) projectile won't collide with owner (if owner == 0, projectile will hit any client). + +#define TE_SPRAY 120 // Throws a shower of sprites or models +// coord, coord, coord (position) +// coord, coord, coord (direction) +// short (modelindex) +// byte (count) +// byte (speed) +// byte (noise) +// byte (rendermode) + +#define TE_PLAYERSPRITES 121 // sprites emit from a player's bounding box (ONLY use for players!) +// byte (playernum) +// short (sprite modelindex) +// byte (count) +// byte (variance) (0 = no variance in size) (10 = 10% variance in size) + +#define TE_PARTICLEBURST 122 // very similar to lavasplash. +// coord (origin) +// short (radius) +// byte (particle color) +// byte (duration * 10) (will be randomized a bit) + +#define TE_FIREFIELD 123 // makes a field of fire. +// coord (origin) +// short (radius) (fire is made in a square around origin. -radius, -radius to radius, radius) +// short (modelindex) +// byte (count) +// byte (flags) +// byte (duration (in seconds) * 10) (will be randomized a bit) +// // to keep network traffic low, this message has associated flags that fit into a byte: -#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate -#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance) -#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. -#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque -#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube. -#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered non-opaque with additive - -#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent) -#define TE_KILLPLAYERATTACHMENTS 125 // will expire all TENTS attached to a player. -#define TE_MULTIGUNSHOT 126 // much more compact shotgun message -#define TE_USERTRACER 127 // larger message than the standard tracer, but allows some customization. - -#define MSG_BROADCAST 0 // unreliable to all -#define MSG_ONE 1 // reliable to one (msg_entity) -#define MSG_ALL 2 // reliable to all -#define MSG_INIT 3 // write to the init string -#define MSG_PVS 4 // Ents in PVS of org -#define MSG_PAS 5 // Ents in PAS of org -#define MSG_PVS_R 6 // Reliable to PVS -#define MSG_PAS_R 7 // Reliable to PAS -#define MSG_ONE_UNRELIABLE 8 // Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) -#define MSG_SPEC 9 // Sends to all spectator proxies +#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate +#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance) +#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. +#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque +#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube. +#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered non-opaque with additive + +#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent) +// byte (entity index of player) +// coord (vertical offset) (attachment origin.z = player origin.z + vertical offset) +// short (model index) +// short (life * 10) + +#define TE_KILLPLAYERATTACHMENTS 125 // will expire all TENTS attached to a player. +// byte (entity index of player) + +#define TE_MULTIGUNSHOT 126 // much more compact shotgun message +// This message is used to make a client approximate a 'spray' of gunfire. +// Any weapon that fires more than one bullet per frame and fires in a bit of a spread is +// a good candidate for MULTIGUNSHOT use. (shotguns) +// +// NOTE: This effect makes the client do traces for each bullet, these client traces ignore +// entities that have studio models.Traces are 4096 long. +// +// coord (origin) +// coord (origin) +// coord (origin) +// coord (direction) +// coord (direction) +// coord (direction) +// coord (x noise * 100) +// coord (y noise * 100) +// byte (count) +// byte (bullethole decal texture index) + +#define TE_USERTRACER 127 // larger message than the standard tracer, but allows some customization. +// coord (origin) +// coord (origin) +// coord (origin) +// coord (velocity) +// coord (velocity) +// coord (velocity) +// byte (life * 10) +// byte (color) this is an index into an array of color vectors in the engine. (0 -) +// byte (length * 10) + +#define MSG_BROADCAST 0 // unreliable to all +#define MSG_ONE 1 // reliable to one (msg_entity) +#define MSG_ALL 2 // reliable to all +#define MSG_INIT 3 // write to the init string +#define MSG_PVS 4 // Ents in PVS of org +#define MSG_PAS 5 // Ents in PAS of org +#define MSG_PVS_R 6 // Reliable to PVS +#define MSG_PAS_R 7 // Reliable to PAS +#define MSG_ONE_UNRELIABLE 8 // Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) +#define MSG_SPEC 9 // Sends to all spectator proxies // contents of a spot in the world -#define CONTENTS_EMPTY -1 -#define CONTENTS_SOLID -2 -#define CONTENTS_WATER -3 -#define CONTENTS_SLIME -4 -#define CONTENTS_LAVA -5 -#define CONTENTS_SKY -6 - -#define CONTENTS_LADDER -16 - -#define CONTENT_FLYFIELD -17 -#define CONTENT_GRAVITY_FLYFIELD -18 -#define CONTENT_FOG -19 - -#define CONTENT_EMPTY -1 -#define CONTENT_SOLID -2 -#define CONTENT_WATER -3 -#define CONTENT_SLIME -4 -#define CONTENT_LAVA -5 -#define CONTENT_SKY -6 +#define CONTENTS_EMPTY -1 +#define CONTENTS_SOLID -2 +#define CONTENTS_WATER -3 +#define CONTENTS_SLIME -4 +#define CONTENTS_LAVA -5 +#define CONTENTS_SKY -6 + +#define CONTENTS_LADDER -16 + +#define CONTENT_FLYFIELD -17 +#define CONTENT_GRAVITY_FLYFIELD -18 +#define CONTENT_FOG -19 + +#define CONTENT_EMPTY -1 +#define CONTENT_SOLID -2 +#define CONTENT_WATER -3 +#define CONTENT_SLIME -4 +#define CONTENT_LAVA -5 +#define CONTENT_SKY -6 // channels -#define CHAN_AUTO 0 -#define CHAN_WEAPON 1 -#define CHAN_VOICE 2 -#define CHAN_ITEM 3 -#define CHAN_BODY 4 -#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area -#define CHAN_STATIC 6 // allocate channel from the static area -#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network -#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). -#define CHAN_BOT 501 // channel used for bot chatter. +#define CHAN_AUTO 0 +#define CHAN_WEAPON 1 +#define CHAN_VOICE 2 +#define CHAN_ITEM 3 +#define CHAN_BODY 4 +#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area +#define CHAN_STATIC 6 // allocate channel from the static area +#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network +#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). +#define CHAN_BOT 501 // channel used for bot chatter. // attenuation values -#define ATTN_NONE 0 -#define ATTN_NORM 0.8 -#define ATTN_IDLE 2.0 -#define ATTN_STATIC 1.25 +#define ATTN_NONE 0 +#define ATTN_NORM 0.8f +#define ATTN_IDLE 2.0f +#define ATTN_STATIC 1.25f // pitch values -#define PITCH_NORM 100 // non-pitch shifted -#define PITCH_LOW 95 // other values are possible - 0-255, where 255 is very high -#define PITCH_HIGH 120 +#define PITCH_NORM 100 // non-pitch shifted +#define PITCH_LOW 95 // other values are possible - 0-255, where 255 is very high +#define PITCH_HIGH 120 // volume values -#define VOL_NORM 1.0 - +#define VOL_NORM 1.0f +// buttons +#ifndef IN_BUTTONS_H +#include "in_buttons.h" +#endif // Break Model Defines -#define BREAK_TYPEMASK 0x4F -#define BREAK_GLASS 0x01 -#define BREAK_METAL 0x02 -#define BREAK_FLESH 0x04 -#define BREAK_WOOD 0x08 +#define BREAK_TYPEMASK 0x4F +#define BREAK_GLASS 0x01 +#define BREAK_METAL 0x02 +#define BREAK_FLESH 0x04 +#define BREAK_WOOD 0x08 -#define BREAK_SMOKE 0x10 -#define BREAK_TRANS 0x20 -#define BREAK_CONCRETE 0x40 -#define BREAK_2 0x80 +#define BREAK_SMOKE 0x10 +#define BREAK_TRANS 0x20 +#define BREAK_CONCRETE 0x40 +#define BREAK_2 0x80 // Colliding temp entity sounds -#define BOUNCE_GLASS BREAK_GLASS -#define BOUNCE_METAL BREAK_METAL -#define BOUNCE_FLESH BREAK_FLESH -#define BOUNCE_WOOD BREAK_WOOD -#define BOUNCE_SHRAP 0x10 -#define BOUNCE_SHELL 0x20 -#define BOUNCE_CONCRETE BREAK_CONCRETE -#define BOUNCE_SHOTSHELL 0x80 +#define BOUNCE_GLASS BREAK_GLASS +#define BOUNCE_METAL BREAK_METAL +#define BOUNCE_FLESH BREAK_FLESH +#define BOUNCE_WOOD BREAK_WOOD +#define BOUNCE_SHRAP 0x10 +#define BOUNCE_SHELL 0x20 +#define BOUNCE_CONCRETE BREAK_CONCRETE +#define BOUNCE_SHOTSHELL 0x80 // Temp entity bounce sound types -#define TE_BOUNCE_NULL 0 -#define TE_BOUNCE_SHELL 1 -#define TE_BOUNCE_SHOTSHELL 2 +#define TE_BOUNCE_NULL 0 +#define TE_BOUNCE_SHELL 1 +#define TE_BOUNCE_SHOTSHELL 2 // Rendering constants enum { - kRenderNormal, // src - kRenderTransColor, // c*a+dest*(1-a) - kRenderTransTexture, // src*a+dest*(1-a) - kRenderGlow, // src*a+dest -- No Z buffer checks - kRenderTransAlpha, // src*srca+dest*(1-srca) - kRenderTransAdd, // src*a+dest + kRenderNormal, // src + kRenderTransColor, // c*a+dest*(1-a) + kRenderTransTexture, // src*a+dest*(1-a) + kRenderGlow, // src*a+dest -- No Z buffer checks + kRenderTransAlpha, // src*srca+dest*(1-srca) + kRenderTransAdd, // src*a+dest }; enum @@ -343,13 +721,13 @@ enum kRenderFxFlickerSlow, kRenderFxFlickerFast, kRenderFxNoDissipation, - kRenderFxDistort, // Distort/scale/translate flicker - kRenderFxHologram, // kRenderFxDistort + distance fade - kRenderFxDeadPlayer, // kRenderAmt is the player index - kRenderFxExplode, // Scale up really big! - kRenderFxGlowShell, // Glowing Shell - kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) - kRenderFxLightMultiplier, //CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier + kRenderFxDistort, // Distort/scale/translate flicker + kRenderFxHologram, // kRenderFxDistort + distance fade + kRenderFxDeadPlayer, // kRenderAmt is the player index + kRenderFxExplode, // Scale up really big! + kRenderFxGlowShell, // Glowing Shell + kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) + kRenderFxLightMultiplier, // CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier }; typedef struct @@ -363,12 +741,12 @@ typedef struct } colorVec; #ifdef _WIN32 -#pragma pack(push,2) +#pragma pack(push, 2) #endif typedef struct { - unsigned short r,g,b,a; + unsigned short r, g, b, a; } PackedColorVec; #ifdef _WIN32 @@ -390,14 +768,14 @@ typedef struct typedef struct { - qboolean allsolid; // if true, plane is not valid - qboolean startsolid; // if true, the initial point was in a solid area + qboolean allsolid; // if true, plane is not valid + qboolean startsolid; // if true, the initial point was in a solid area qboolean inopen, inwater; - float fraction; // time completed, 1.0 = didn't hit anything - vec3_t endpos; // final position - plane_t plane; // surface normal at impact - edict_t *ent; // entity the surface is on - int hitgroup; // 0 == generic, non zero is specific body part + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + plane_t plane; // surface normal at impact + edict_t *ent; // entity the surface is on + int hitgroup; // 0 == generic, non zero is specific body part } trace_t; #endif // CONST_H diff --git a/regamedll/common/winsani_in.h b/regamedll/common/winsani_in.h new file mode 100644 index 000000000..d8c85271b --- /dev/null +++ b/regamedll/common/winsani_in.h @@ -0,0 +1,7 @@ +#if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) +#pragma push_macro("ARRAYSIZE") +#ifdef ARRAYSIZE +#undef ARRAYSIZE +#endif +#define HSPRITE WINDOWS_HSPRITE +#endif diff --git a/regamedll/common/winsani_out.h b/regamedll/common/winsani_out.h new file mode 100644 index 000000000..27269500c --- /dev/null +++ b/regamedll/common/winsani_out.h @@ -0,0 +1,4 @@ +#if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) +#undef HSPRITE +#pragma pop_macro("ARRAYSIZE") +#endif diff --git a/regamedll/dlls/extdll.h b/regamedll/dlls/extdll.h index f85b2939b..63baf4d32 100644 --- a/regamedll/dlls/extdll.h +++ b/regamedll/dlls/extdll.h @@ -44,7 +44,10 @@ #define NOSERVICE #define NOMCX #define NOIME - #include + #include "winsani_in.h" + #include "windows.h" + #include "winsani_out.h" + #undef PlaySound #else #include #include @@ -57,11 +60,13 @@ #include "math.h" // Header file containing definition of globalvars_t and entvars_t +typedef int EOFFSET; // More explicit than "int" typedef unsigned int func_t; typedef float vec_t; // needed before including progdefs.h // Vector class #include "vector.h" + // Defining it as a (bogus) struct helps enforce type-checking #define vec3_t Vector @@ -74,6 +79,7 @@ typedef float vec_t; // needed before including progdefs.h // Shared header describing protocol between engine and DLLs #include "eiface.h" + // Shared header between the client DLL and the game DLLs #include "cdll_dll.h" #include "extdef.h" diff --git a/regamedll/engine/maintypes.h b/regamedll/engine/maintypes.h index 2430eaee8..2b63299f0 100644 --- a/regamedll/engine/maintypes.h +++ b/regamedll/engine/maintypes.h @@ -44,17 +44,33 @@ // Function is doubt reversed #define TODOBODY - #define BIT(n) (1<<(n)) +#ifdef HAVE_STRONG_TYPEDEF +enum class string_t: unsigned int {}; +#else typedef unsigned int string_t; +#endif + typedef int EOFFSET; typedef int BOOL; +typedef unsigned char byte; +typedef unsigned short word; +#define _DEF_BYTE_ #ifndef __cplusplus - typedef enum { false, true } qboolean; + #undef true + #undef false + typedef enum {false, true} qboolean; #else typedef int qboolean; -#endif +#endif // #ifndef __cplusplus + +// From engine/server.h +typedef enum sv_delta_s +{ + sv_packet_nodelta, + sv_packet_delta, +} sv_delta_t; #endif // MAINTYPES_H From 3aa987212e5a66f0929d22abb415ce49a9d29b4d Mon Sep 17 00:00:00 2001 From: s1lent Date: Fri, 30 Aug 2019 00:46:52 +0700 Subject: [PATCH 15/15] gradle.properties: bump minor --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2c9a91828..e37cb4289 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ majorVersion=5 -minorVersion=10 +minorVersion=11 maintenanceVersion=0