Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,23 @@ jobs:
steps:
- name: Install dependencies
run: |
dpkg --add-architecture i386
apt-get update
apt-get install -y \
# Debian 11 reached end of LTS on 2026-08-31: the bullseye-security
# suite is frozen and its pool is being pruned from deb.debian.org.
# Keep the same toolchain, but fetch the base suite from the Debian
# archive and pin the security suite to its last complete snapshot.
# The security suite is fetched from the cloudflare snapshot mirror:
# plain snapshot.debian.org throttles CI bursts with connection
# resets, and https needs ca-certificates, which debian:11-slim
# does not ship, so bootstrap it from the archive first.
cat > /etc/apt/sources.list <<'EOF'
deb http://archive.debian.org/debian bullseye main
deb http://archive.debian.org/debian bullseye-updates main
EOF
apt-get -o Acquire::Check-Valid-Until=false update
apt-get install -y --no-install-recommends ca-certificates
echo 'deb https://snapshot-cloudflare.debian.org/archive/debian-security/20260831T000000Z bullseye-security main' > /etc/apt/sources.list.d/bullseye-security.list
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Retries=5 update
apt-get -o Acquire::Retries=5 install -y \
gcc-multilib g++-multilib \
build-essential \
libc6-dev libc6-dev-i386 \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_stamina_restore_rate | 0 | 0.0 | - | Framerate (FPS), that used as reference when restoring stamina (fuser2) after jump. |
| mp_logkills | 1 | 0 | 1 | Log kills.<br/>`0` disabled <br/>`1` enabled |
| mp_jump_height | 45 | 0.0 | - | Player jump height. |
| mp_longjump_cooldown | 0.0 | 0.0 | - | Cooldown time (in seconds) between long jumps to prevent abuse.<br/>`0` disabled<br/>`>0` seconds before the player can long jump again. During cooldown, only a regular vertical jump is performed. |
| bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. |
| mp_randomspawn | 0 | 0 | 1 | Random player spawns<br/>`0` disabled <br/>`1` enabled<br/>`NOTE`: Navigation `maps/.nav` file required |
| mp_playerid_showhealth | 1 | 0 | 2 | Player ID display mode.<br/>`0` don't show health<br/>`1` show health for teammates only (default CS behaviour)<br/>`2` show health for all players |
Expand Down
7 changes: 7 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,13 @@ mp_stamina_restore_rate "0"
// Default value: "45"
mp_jump_height "45"

// Cooldown time (in seconds) between long jumps to prevent abuse.
// 0 - disabled (default behaviour)
// >0 - seconds before the player can long jump again
//
// Default value: "0.0"
mp_longjump_cooldown "0.0"

// Bots always have great morale regardless of defeat or victory.
// 0 - disabled (default behaviour)
// 1 - enabled
Expand Down
6 changes: 5 additions & 1 deletion regamedll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif()

# do not strip debuginfo during link
if (NOT DEBUG)
set(LINK_FLAGS "-s")
set(LINK_FLAGS "")
endif()

# add -m32 flag only on 64-bit systems, if building for 64-bit wasn't enabled with XASH_COMPAT
Expand Down Expand Up @@ -437,6 +437,10 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT ANDROID)
set(LINK_FLAGS "${LINK_FLAGS} -L${PROJECT_SOURCE_DIR}/lib/linux32")
endif()

if (UNIX AND NOT APPLE AND NOT ANDROID)
set(LINK_FLAGS "${LINK_FLAGS} -Wl,-z,notext")
endif()

if (NOT MSVC)
set_target_properties(regamedll PROPERTIES
COMPILE_FLAGS ${COMPILE_FLAGS}
Expand Down
4 changes: 4 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cvar_t *g_psv_stopspeed = nullptr;
cvar_t *g_psv_stepsize = nullptr;
cvar_t *g_psv_clienttrace = nullptr;
cvar_t *g_psv_maxvelocity = nullptr;
cvar_t *g_psv_zmax = nullptr;

cvar_t displaysoundlist = { "displaysoundlist", "0", 0, 0.0f, nullptr };
cvar_t timelimit = { "mp_timelimit", "0", FCVAR_SERVER, 0.0f, nullptr };
Expand Down Expand Up @@ -174,6 +175,7 @@ cvar_t assist_damage_threshold = { "mp_assist_damage_threshold", "40",
cvar_t freezetime_duck = { "mp_freezetime_duck", "1", 0, 1.0f, nullptr };
cvar_t freezetime_jump = { "mp_freezetime_jump", "1", 0, 1.0f, nullptr };
cvar_t jump_height = { "mp_jump_height", "45", FCVAR_SERVER, 45.0f, nullptr };
cvar_t longjump_cooldown = { "mp_longjump_cooldown", "0.0", 0, 0.0f, nullptr };

cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr };

Expand Down Expand Up @@ -272,6 +274,7 @@ void EXT_FUNC GameDLLInit()
g_psv_stepsize = CVAR_GET_POINTER("sv_stepsize");
g_psv_clienttrace = CVAR_GET_POINTER("sv_clienttrace");
g_psv_maxvelocity = CVAR_GET_POINTER("sv_maxvelocity");
g_psv_zmax = CVAR_GET_POINTER("sv_zmax");

CVAR_REGISTER(&displaysoundlist);
CVAR_REGISTER(&timelimit);
Expand Down Expand Up @@ -469,6 +472,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&freezetime_duck);
CVAR_REGISTER(&freezetime_jump);
CVAR_REGISTER(&jump_height);
CVAR_REGISTER(&longjump_cooldown);
CVAR_REGISTER(&defuser_allocation);
CVAR_REGISTER(&location_area_info);
CVAR_REGISTER(&chat_loc_fallback);
Expand Down
2 changes: 2 additions & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extern cvar_t *g_psv_stopspeed;
extern cvar_t *g_psv_stepsize;
extern cvar_t *g_psv_clienttrace;
extern cvar_t *g_psv_maxvelocity;
extern cvar_t *g_psv_zmax;

extern cvar_t displaysoundlist;
extern cvar_t timelimit;
Expand Down Expand Up @@ -203,6 +204,7 @@ extern cvar_t assist_damage_threshold;
extern cvar_t freezetime_duck;
extern cvar_t freezetime_jump;
extern cvar_t jump_height;
extern cvar_t longjump_cooldown;
extern cvar_t defuser_allocation;
extern cvar_t location_area_info;
extern cvar_t chat_loc_fallback;
Expand Down
4 changes: 3 additions & 1 deletion regamedll/dlls/mapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ void CMapInfo::OnCreate()

void CMapInfo::OnDestroy()
{
g_pMapInfo = nullptr;
// Only the instance that owns the global may clear it.
if (g_pMapInfo == this)
g_pMapInfo = nullptr;
}

void CMapInfo::CheckMapInfo()
Expand Down
31 changes: 30 additions & 1 deletion regamedll/dlls/plats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,19 @@ void CFuncTrackTrain::StopSound()
// if sound playing, stop it
if (m_soundPlaying && pev->noise)
{
#ifdef REGAMEDLL_FIXES
// Stop the sound through the engine sound API: SND_STOP is delivered as a reliable
// broadcast, while the event is PVS-filtered and can be missed by distant players,
// leaving the engine loop running on their side.
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), 0, 0, SND_STOP, PITCH_NORM);
#else
unsigned short us_encode;
unsigned short us_sound = ((unsigned short)(m_sounds) & 0x0007) << 12;

us_encode = us_sound;

PLAYBACK_EVENT_FULL(FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, us_encode, 0, 1, 0);
#endif
EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "plats/ttrain_brake1.wav", m_flVolume, ATTN_NORM, 0, 100);
}

Expand All @@ -1070,19 +1077,40 @@ void CFuncTrackTrain::UpdateSound()

#ifdef REGAMEDLL_FIXES
float flpitch = TRAIN_STARTPITCH + (Q_abs(pev->speed) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED);

// The engine sound API carries the pitch as a byte, keep it inside the intended range
if (flpitch > TRAIN_MAXPITCH)
flpitch = TRAIN_MAXPITCH;

// Never report the engine pitch as exactly PITCH_NORM: a looping sound that is
// re-pitched to 100 drops out of the client's pitch-shifting mixer back into the
// plain playback path, which then runs past the end of the wave and mixes in
// whatever sound follows it in the client's sound cache.
// Same guard as CFuncRotating::RampPitchVol() and CAmbientGeneric.
int ipitch = int(flpitch);
if (ipitch == PITCH_NORM)
ipitch = PITCH_NORM - 1;
#else
float flpitch = TRAIN_STARTPITCH + (Q_abs(int(pev->speed)) * (TRAIN_MAXPITCH - TRAIN_STARTPITCH) / TRAIN_MAXSPEED);
int ipitch = int(flpitch);
#endif

if (!m_soundPlaying)
{
// play startup sound for train
EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "plats/ttrain_start1.wav", m_flVolume, ATTN_NORM, 0, 100);
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), m_flVolume, ATTN_NORM, 0, int(flpitch));
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), m_flVolume, ATTN_NORM, 0, ipitch);
m_soundPlaying = 1;
}
else
{
#ifdef REGAMEDLL_FIXES
// Update pitch/volume through the engine sound API instead of the client event:
// the event packs the pitch as pitch / 10 into 6 bits, so the range is quantized
// to steps of 10 and everything in [100, 110) arrives as PITCH_NORM. The event is
// also PVS-filtered, while the sound itself is started with a reliable broadcast.
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), m_flVolume, ATTN_NORM, SND_CHANGE_PITCH | SND_CHANGE_VOL, ipitch);
#else
// update pitch
// EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noise), m_flVolume, ATTN_NORM, SND_CHANGE_PITCH, int(flpitch));

Expand All @@ -1099,6 +1127,7 @@ void CFuncTrackTrain::UpdateSound()
us_encode = us_sound | us_pitch | us_volume;

PLAYBACK_EVENT_FULL(FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, us_encode, 0, 0, 0);
#endif
}
}

Expand Down
34 changes: 31 additions & 3 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4281,7 +4281,19 @@ void CBasePlayer::PlayerUse()
if (legacy_vehicle_block.value == 0)
return;
#endif
((CFuncVehicle *)pTrain)->m_pDriver = nullptr;
CFuncVehicle *pVehicle = (CFuncVehicle *)pTrain;
pVehicle->m_pDriver = nullptr;
#ifdef REGAMEDLL_FIXES
if (Q_abs(pTrain->pev->speed) < 50)
{
pVehicle->StopSound();
pVehicle->SetThink(nullptr);
pTrain->pev->speed = 0;
pTrain->pev->velocity = g_vecZero;
pTrain->pev->avelocity = g_vecZero;
pVehicle->m_fEngineOn = FALSE;
}
#endif
}
return;
}
Expand All @@ -4299,8 +4311,18 @@ void CBasePlayer::PlayerUse()

if (pTrain->Classify() == CLASS_VEHICLE)
{
CFuncVehicle *pVehicle = (CFuncVehicle *)pTrain;
#ifdef REGAMEDLL_FIXES
if (!pVehicle->m_fEngineOn)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "plats/vehicle_ignition.wav", 0.8, ATTN_NORM);
pVehicle->m_fEngineOn = TRUE;
pVehicle->UpdateSound();
}
#else
EMIT_SOUND(ENT(pev), CHAN_ITEM, "plats/vehicle_ignition.wav", 0.8, ATTN_NORM);
((CFuncVehicle *)pTrain)->m_pDriver = this;
#endif
pVehicle->m_pDriver = this;
}
else
EMIT_SOUND(ENT(pev), CHAN_ITEM, "plats/train_use1.wav", 0.8, ATTN_NORM);
Expand Down Expand Up @@ -8252,7 +8274,13 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateStatusBar)()
UTIL_MakeVectors(pev->v_angle + pev->punchangle);

Vector vecSrc = EyePosition();
Vector vecEnd = vecSrc + (gpGlobals->v_forward * ((pev->flags & FL_SPECTATOR) != 0 ? MAX_SPEC_ID_RANGE : MAX_ID_RANGE));
Vector vecEnd = vecSrc + (gpGlobals->v_forward * ((pev->flags & FL_SPECTATOR) != 0 ? MAX_SPEC_ID_RANGE :
#ifdef REGAMEDLL_ADD
(g_psv_zmax ? g_psv_zmax->value : MAX_ID_RANGE)
#else
MAX_ID_RANGE
#endif
));

UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr);

Expand Down
4 changes: 4 additions & 0 deletions regamedll/dlls/trains.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ class CFuncVehicle: public CBaseEntity
Vector m_vSurfaceNormal;
Vector m_vVehicleDirection;
CBaseEntity *m_pDriver;
#ifdef REGAMEDLL_FIXES
int m_iCollisionCount;
BOOL m_fEngineOn;
#endif

private:
unsigned short m_usAdjustPitch;
Expand Down
Loading
Loading