Repository navigation
Sync with upstream - #7
Merged
Merged
Conversation
…bled (rehlds#1162) When hostage_ai_enable is set in CS 1.6 but bots are not allowed (dedicated server without bot_enable), CCSBotManager::LoadNavigationMap returns early and never frees the navigation mesh of the previous map. LoadNavigationMap() then sees a non-empty TheNavAreaList and keeps the stale nav data, so on the next hostage map CHostageImprov is created against the wrong navigation mesh: hostages freeze and stop responding to +use. Destroy the stale navigation data in CHostageManager::ServerActivate before loading, but only when bots are not allowed - otherwise CCSBotManager has already reloaded the nav mesh earlier in the same ServerActivate and holds pointers into it. Fixes rehlds#1161 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Fix global buffer overflow in SharedParse() SharedParse() copies each parsed token into the fixed-size global buffer s_shared_token[1500] without any bounds checking. A single token (a quoted string or an unquoted word) longer than 1499 bytes overflows the buffer and corrupts adjacent globals, which can crash the server or corrupt state. The buffer is fed from data files parsed via LOAD_FILE_FOR_ME (botprofile.db, BotChatter.db, mapcycle.txt, tutor messages) and from the default-weapon cvars, so a malformed or malicious file/config triggers the overflow. Bound all three write sites to sizeof(s_shared_token) - 1, matching the existing pattern already used in CBasePlayer::ParseAutoBuyString(). Well-formed input is unaffected; only pathologically long tokens are now truncated. Add unit tests covering oversized unquoted/quoted tokens and normal token parsing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix CHECK macro usage in SharedParse unit tests cppunitlite CHECK takes (message, condition); single-argument form broke the Tests build on CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix global buffer overflow in PrioritizeAutoBuyString() priorityToken[32] is filled from the client-supplied autobuy string (m_autoBuyString) without any bounds checking. A single autobuy token longer than 31 characters overflows the buffer and corrupts adjacent stack state during career-mode auto-buy. Bound the token copy to sizeof(priorityToken) - 1, matching the pattern in ParseAutoBuyString(), and skip the rest of an oversized token so it is not re-split into a spurious priority token on the next iteration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…eams are full (rehlds#1168) * Prevent mp_forcerespawn from spawning players without a team PlayerRespawnThink only applied the UNASSIGNED/SPECTATOR check to observers, so a non-observer player stuck at the team select menu (both teams full) with mp_forcerespawn > 0 and mp_auto_join_team 1 got a pending respawn and spawned while on TEAM_UNASSIGNED. Fixes rehlds#929 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Deny auto-team-select when both teams are full HandleMenu_ChooseTeam with MENU_SLOT_TEAM_RANDOM fell through with team == UNASSIGNED when SelectDefaultTeam() found both teams full and no bot could be vacated: TeamFull(UNASSIGNED) and TeamStacked() pass, so the player joined UNASSIGNED and got into the game, spawning via GetIntoGame() since FPlayerCanRespawn() always passes with mp_forcerespawn > 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…#1167) When improved hostage AI (hostage_ai_enable 1) is used in CS 1.6, hostages panic and scatter in response to gunfire, explosions and nearby deaths. Setting mp_hostage_fear 0 keeps them calm, restoring 1.6-like hostage behavior while retaining the rest of the improved AI. Related to rehlds#1125 Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…er (rehlds#1164) * Add mp_show_bomb_timer cvar: show C4 countdown on the HUD round timer When enabled, the HUD round timer shows the time remaining until the planted C4 explodes instead of hiding after the bomb plant, and is restored back to the round time after a successful defuse. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Restore the HUD round timer after the bomb explodes With mp_show_bomb_timer enabled the round timer shows the C4 countdown after a plant. If the bomb round-end check is blocked (mp_round_infinite flag e), the explosion does not end the round and the HUD timer stays frozen at 0:00 until the next resync event. Resync the timer for all players in CGrenade::Explode2 so it falls back to the real round time once the bomb has blown, mirroring the resync already done on defuse. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…ehlds#1163) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Regression from rehlds#1045: replacing the hardcoded pistol allow-list with !IsSecondaryWeapon(m_iId) dropped the explicit knife exception. Since the knife is not a secondary weapon, DefaultTouch rejected it for a VIP, so GiveDefaultItems() (which routes weapon_knife through DispatchTouch) left the VIP without a knife while the pistol was still given. Restore the knife exception in the REGAMEDLL_FIXES branch. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…1170) Drowning damage is tracked in m_idrowndmg and "given back" as health via DMG_DROWNRECOVER once the player takes a breath. The tracker must only ever hold damage that was actually applied. The existing REGAMEDLL_FIXES guard checked the DMG_DROWN bit in m_bitsDamageType, but CBasePlayer::TakeDamage sets that bit unconditionally at the end, even when CBaseMonster::TakeDamage refused the damage because pev->takedamage == DAMAGE_NO. So an invulnerable player still accumulated m_idrowndmg while drowning, and on surfacing that phantom damage was restored as free health (up to max_health). Gate the tracking on the actual return value of TakeDamage instead: it is FALSE both when damage is refused (DAMAGE_NO) and when the tick was lethal (and possibly followed by respawn), which is exactly when we must not track. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.