Skip to content

Commit

Permalink
Partial merge remote-tracking branch 'Half-LifeUpdated/master'
Browse files Browse the repository at this point in the history
Some HL25 changes were not backported to stay on par with the "vanilla"
game.
  • Loading branch information
JoelTroch committed Sep 1, 2024
2 parents b028cf2 + 6b87c49 commit d53e3a4
Show file tree
Hide file tree
Showing 170 changed files with 38,513 additions and 16,599 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Force CRLF for Windows files:
*.bat text eol=crlf
*.dsp text eol=crlf
*.dsw text eol=crlf
*.sln text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Allow Half-Life-specific files that would otherwise be ignored
!lib/public/game_controls.lib
!lib/public/SDL2.lib
!utils/procinfo/lib/win32_vc6/procinfo.lib
!utils/vgui/lib/win32_vc6/vgui.lib
!utils/vgui/lib/win32_vc16/vgui.lib
56 changes: 54 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Half-Life: Blue Shift Updated changelog

## Changes in V1.1.0

Most changes from Half-Life Updated up until V1.1.0 are included. HL25 gameplay changes were not backported to be on par with the "vanilla" game.

* Applied bug fixing work done for Half-Life Updated to this project as well

## Changes in V1.0.0

All changes from Half-Life Updated up until V1.0.0 are included.
Expand Down Expand Up @@ -102,14 +108,60 @@ All changes from Half-Life Updated up until Beta 5 are included.

## Changes in V1.1.0

> Note: this update has not been released yet.
### Bug Fixes

* Fixed potential buffer overflows in text localization (Thanks OMAM)
* Reset frame to 0 when grenade bounces [#238](https://github.com/twhl-community/halflife-updated/issues/238) (Thanks FreeSlave)
* Fixed weapon events not treating pushable objects as BSP models [#220](https://github.com/twhl-community/halflife-updated/pull/220) (Thanks Toodles2You)
* Fixed crowbar applying breakable glass decals to unbreakable pushable objects [#219](https://github.com/twhl-community/halflife-updated/pull/219) (Thanks Toodles2You)
* [HL25] Fixed client/server view origin/angles sync and view bob affectation
* [HL25] Fixed crowbar full swing logic (already fixed but reverted to use HL25's version for consistency)
* [HL25] Fixed `func_pushable` framerate/input handling
* [HL25] Fixed geiger counter sound at range 800 units and higher
* [HL25] Fixed "ghost shots" syndrome (backported from Counter-Strike)
* [HL25] Fixed Gluon gun's flare sprite (already fixed but reverted to use HL25's version for consistency)
* [HL25] Fixed how flesh sounds are handled on entities
* [HL25] Fixed monsters turning speed being dependant on framerate (already fixed but reverted to use HL25's version for consistency)
* [HL25] Fixed potential null pointer on field name when restoring (loading saved game) entities
* [HL25] Fixed some player movement cases where client can be stuck
* [HL25] Fixed some joystick and mouse sensitivity issues
* [HL25] Fixed some unsafe string operations
* [HL25] Fixed some out of bounds indexes
* [HL25] Fixed `trigger_hurt` healing dead players in multiplayer
* [HL25] Fixed incorrect touch function reference in the unused trip beam entity
* [HL25] Renamed extra CVAR flags including their description to HL25's SDK counterpart for consistency
* [HL25] Reworked how multiplayer corpses are handled to fix various issues

### Features

* Removed some leftovers related to the Mac platform
* [HL25] Added `EngineFilteredClientCmd` macro on the client project
* [HL25] Added `_sv_override_scientist_mdl` CVAR functionality
* [HL25] Added `sv_allow_autoaim` CVAR functionality
* [HL25] Added 1280 and 2560 HUD resolutions support (including other changes to the HUD)
* [HL25] Added changes to 9mm AR's default magazine capacity (25 if singleplayer, 50 if multiplayer)
* [HL25] Added changes to multiplayer spawn selection logic
* [HL25] Added changes to the Gauss gun's charging mechanic
* [HL25] Added changes to the hand grenade throwing arc
* [HL25] Added changes to the hive hand's (hornet gun) auto-switch weight and recharge time (faster if multiplayer)
* [HL25] Added changes to the RPG's empty sound, rocket tracking and detonation if touching the sky
* [HL25] Added changes to the sentences system (moved from `CBaseMonster` to `CBaseToggle`)
* [HL25] Added changes to the snarks throw
* [HL25] Added comments about the `netadr_s` structure
* [HL25] Added "busters" multiplayer game mode
* [HL25] Added `END3` message to end the game functionality
* [HL25] Added `func_vehicle` entity
* [HL25] Added "modern" satchel charge/radio controls (those who want the "legacy" behavior can comment the `MODERN_SATCHEL_CONTROLS` define at the beginning of `dlls/satchel.cpp`)
* [HL25] Added multiplayer specific limit of live satchels per player
* [HL25] Added new method to filesystem interface
* [HL25] Added Python's damage buff in multiplayer (from 40 to 50)
* [HL25] Added Steam Rich Presence commands calls (disabled due to being reserved to mods hosted on Steam, see `STEAM_RICH_PRESENCE` define)
* [HL25] Increased max. sentences count from 1536 to 2048
* [HL25] Made players non-solid upon dying in multiplayer
* [HL25] Made dropping active weapon to be reloaded before actually dropping it
* [HL25] Server will now execute `spserver.cfg` when initializing singleplayer game rules
* [HL25] Updated procinfo, SDL2, Steam types and VGUI 1 dependencies


## Changes in V1.0.0

Expand Down
4 changes: 2 additions & 2 deletions FULL_UPDATED_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is the changelog from Steam Half-Life: Blue Shift to Half-Life: Blue Shift Updated version 1.0.0.
This is the changelog from Steam Half-Life: Blue Shift to Half-Life: Blue Shift Updated version 1.1.0.

Fixes for bugs introduced in beta builds are not included in this list.

Expand Down Expand Up @@ -31,7 +31,7 @@ See the full changelog for Half-Life Updated below for changes shared with the b

---

This is the changelog from Steam Half-Life to Half-Life Updated version 1.0.0.
This is the changelog from Steam Half-Life to Half-Life Updated version 1.1.0.

Fixes for bugs introduced in beta builds are not included in this list.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ See [CHANGELOG.md](CHANGELOG.md) and [FULL_UPDATED_CHANGELOG.md](FULL_UPDATED_CH

# Half Life 1 SDK LICENSE

Half Life 1 SDK Copyright© Valve Corp.
Half Life 1 SDK Copyright © Valve Corp.

THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE READ IT BEFORE DOWNLOADING OR USING THE HALF LIFE 1 SDK (“SDK”). BY DOWNLOADING AND/OR USING THE SOURCE ENGINE SDK YOU ACCEPT THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE PLEASE DON’T DOWNLOAD OR USE THE SDK.

Expand Down
24 changes: 23 additions & 1 deletion cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,8 @@ bool CHudAmmo::MsgFunc_WeaponList(const char* pszName, int iSize, void* pbuf)

WEAPON Weapon;

strcpy(Weapon.szName, READ_STRING());
strncpy(Weapon.szName, READ_STRING(), MAX_WEAPON_NAME);
Weapon.szName[sizeof(Weapon.szName) - 1] = '\0';
Weapon.iAmmoType = (int)READ_CHAR();

Weapon.iMax1 = READ_BYTE();
Expand All @@ -656,6 +657,27 @@ bool CHudAmmo::MsgFunc_WeaponList(const char* pszName, int iSize, void* pbuf)
Weapon.iFlags = READ_BYTE();
Weapon.iClip = 0;

if (Weapon.iId < 0 || Weapon.iId >= MAX_WEAPONS)
return 0;

if (Weapon.iSlot < 0 || Weapon.iSlot >= MAX_WEAPON_SLOTS + 1)
return 0;

if (Weapon.iSlotPos < 0 || Weapon.iSlotPos >= MAX_WEAPON_POSITIONS + 1)
return 0;

if (Weapon.iAmmoType < -1 || Weapon.iAmmoType >= MAX_AMMO_TYPES)
return 0;

if (Weapon.iAmmo2Type < -1 || Weapon.iAmmo2Type >= MAX_AMMO_TYPES)
return 0;

if (Weapon.iAmmoType >= 0 && Weapon.iMax1 == 0)
return 0;

if (Weapon.iAmmo2Type >= 0 && Weapon.iMax2 == 0)
return 0;

gWR.AddWeapon(&Weapon);

return true;
Expand Down
1 change: 1 addition & 0 deletions cl_dll/cl_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ inline struct cvar_s* CVAR_CREATE(const char* cv, const char* val, const int fla
#define GetScreenInfo (*gEngfuncs.pfnGetScreenInfo)
#define ServerCmd (*gEngfuncs.pfnServerCmd)
#define EngineClientCmd (*gEngfuncs.pfnClientCmd)
#define EngineFilteredClientCmd (*gEngfuncs.pfnFilteredClientCmd)
#define SetCrosshair (*gEngfuncs.pfnSetCrosshair)
#define AngleVectors (*gEngfuncs.pfnAngleVectors)

Expand Down
2 changes: 1 addition & 1 deletion cl_dll/death.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool CHudDeathNotice::Init()

HOOK_MESSAGE(DeathMsg);

CVAR_CREATE("hud_deathnotice_time", "6", 0);
CVAR_CREATE("hud_deathnotice_time", "6", FCVAR_ARCHIVE);

return true;
}
Expand Down
86 changes: 32 additions & 54 deletions cl_dll/ev_hldm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ float EV_HLDM_PlayTextureSound(int idx, pmtrace_t* ptr, float* vecSrc, float* ve
{
// hit the world, try to play sound based on texture material type
char chTextureType = CHAR_TEX_CONCRETE;
cl_entity_t* cl_entity = NULL;
float fvol;
float fvolbar;
const char* rgsz[4];
Expand All @@ -84,12 +85,7 @@ float EV_HLDM_PlayTextureSound(int idx, pmtrace_t* ptr, float* vecSrc, float* ve
chTextureType = 0;

// Player
if (entity >= 1 && entity <= gEngfuncs.GetMaxClients())
{
// hit body
chTextureType = CHAR_TEX_FLESH;
}
else if (entity == 0)
if (entity == 0)
{
// get texture from entity or world (world is ent(0))
pTextureName = (char*)gEngfuncs.pEventAPI->EV_TraceTexture(ptr->ent, vecSrc, vecEnd);
Expand Down Expand Up @@ -118,6 +114,20 @@ float EV_HLDM_PlayTextureSound(int idx, pmtrace_t* ptr, float* vecSrc, float* ve
chTextureType = PM_FindTextureType(szbuffer);
}
}
else
{
// JoshA: Look up the entity and find the EFLAG_FLESH_SOUND flag.
// This broke at some point then TF:C added prediction.
//
// It used to use Classify of pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE
// to determine what sound to play, but that's server side and isn't available on the client
// and got lost in the translation to that.
// Now the server will replicate that state via an eflag.
cl_entity = gEngfuncs.GetEntityByIndex(entity);

if (cl_entity && !!(cl_entity->curstate.eflags & EFLAG_FLESH_SOUND))
chTextureType = CHAR_TEX_FLESH;
}

switch (chTextureType)
{
Expand Down Expand Up @@ -388,7 +398,16 @@ void EV_HLDM_FireBullets(int idx, float* forward, float* right, float* up, int c
gEngfuncs.pEventAPI->EV_SetSolidPlayers(idx - 1);

gEngfuncs.pEventAPI->EV_SetTraceHull(2);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr);
// JoshA: Changed from PM_STUDIO_BOX to PM_NORMAL in prediction code as otherwise if you hit an NPC or player's
// bounding box but not one of their hitboxes, the shot won't hit on the server but it will
// play a hit sound on the client and not make a decal (as if it hit the NPC/player).
// We should mirror the way the server does the test here as close as possible.
//
// I initially thought I was just fixing some stupid Half-Life bug but no,
// this is *the* root cause of all the ghost shot bad prediction bugs in Half-Life Deathmatch!
//
// Also... CStrike was always using PM_NORMAL for all of these so it didn't have the problem.
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_NORMAL, -1, &tr);

EV_HLDM_CheckTracer(idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount);

Expand Down Expand Up @@ -877,7 +896,7 @@ void EV_FireGauss(event_args_t* args)
gEngfuncs.pEventAPI->EV_SetSolidPlayers(idx - 1);

gEngfuncs.pEventAPI->EV_SetTraceHull(2);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecDest, PM_STUDIO_BOX, -1, &tr);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecDest, PM_NORMAL, -1, &tr);

gEngfuncs.pEventAPI->EV_PopPMStates();

Expand Down Expand Up @@ -996,7 +1015,7 @@ void EV_FireGauss(event_args_t* args)
gEngfuncs.pEventAPI->EV_SetSolidPlayers(idx - 1);

gEngfuncs.pEventAPI->EV_SetTraceHull(2);
gEngfuncs.pEventAPI->EV_PlayerTrace(start, vecDest, PM_STUDIO_BOX, -1, &beam_tr);
gEngfuncs.pEventAPI->EV_PlayerTrace(start, vecDest, PM_NORMAL, -1, &beam_tr);

if (0 == beam_tr.allsolid)
{
Expand All @@ -1005,7 +1024,7 @@ void EV_FireGauss(event_args_t* args)

// trace backwards to find exit point

gEngfuncs.pEventAPI->EV_PlayerTrace(beam_tr.endpos, tr.endpos, PM_STUDIO_BOX, -1, &beam_tr);
gEngfuncs.pEventAPI->EV_PlayerTrace(beam_tr.endpos, tr.endpos, PM_NORMAL, -1, &beam_tr);

VectorSubtract(beam_tr.endpos, tr.endpos, delta);

Expand Down Expand Up @@ -1172,7 +1191,7 @@ void EV_FireCrossbow2(event_args_t* args)
// Now add in all of the players.
gEngfuncs.pEventAPI->EV_SetSolidPlayers(idx - 1);
gEngfuncs.pEventAPI->EV_SetTraceHull(2);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_NORMAL, -1, &tr);

//We hit something
if (tr.fraction < 1.0)
Expand Down Expand Up @@ -1282,17 +1301,6 @@ int g_fireAnims2[] = {EGON_ALTFIRECYCLE};

BEAM* pBeam;
BEAM* pBeam2;
TEMPENTITY* pFlare; // Vit_amiN: egon's beam flare

void EV_EgonFlareCallback(struct tempent_s* ent, float frametime, float currenttime)
{
float delta = currenttime - ent->tentOffset.z; // time past since the last scale
if (delta >= ent->tentOffset.y)
{
ent->entity.curstate.scale += ent->tentOffset.x * delta;
ent->tentOffset.z = currenttime;
}
}

void EV_EgonFire(event_args_t* args)
{
Expand Down Expand Up @@ -1330,7 +1338,7 @@ void EV_EgonFire(event_args_t* args)
if (EV_IsLocal(idx))
gEngfuncs.pEventAPI->EV_WeaponAnimation(g_fireAnims1[gEngfuncs.pfnRandomLong(0, 3)], 0);

if (iStartup && EV_IsLocal(idx) && !pBeam && !pBeam2 && !pFlare && 0 != cl_lw->value) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
if (iStartup && EV_IsLocal(idx) && !pBeam && !pBeam2 && 0 != cl_lw->value) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
{
Vector vecSrc, vecEnd, angles, forward, right, up;
pmtrace_t tr;
Expand All @@ -1356,7 +1364,7 @@ void EV_EgonFire(event_args_t* args)
gEngfuncs.pEventAPI->EV_SetSolidPlayers(idx - 1);

gEngfuncs.pEventAPI->EV_SetTraceHull(2);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr);
gEngfuncs.pEventAPI->EV_PlayerTrace(vecSrc, vecEnd, PM_NORMAL, -1, &tr);

gEngfuncs.pEventAPI->EV_PopPMStates();

Expand All @@ -1380,18 +1388,8 @@ void EV_EgonFire(event_args_t* args)
pBeam->flags |= (FBEAM_SINENOISE);

pBeam2 = gEngfuncs.pEfxAPI->R_BeamEntPoint(idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 5.0, 0.08, 0.7, 25, 0, 0, r, g, b);

// Vit_amiN: egon beam flare
pFlare = gEngfuncs.pEfxAPI->R_TempSprite(tr.endpos, vec3_origin, 1.0,
gEngfuncs.pEventAPI->EV_FindModelIndex(EGON_FLARE_SPRITE),
kRenderGlow, kRenderFxNoDissipation, 1.0, 99999, FTENT_SPRCYCLE | FTENT_PERSIST);
}
}

if (pFlare) // Vit_amiN: store the last mode for EV_EgonStop()
{
pFlare->tentOffset.x = (iFireMode == FIRE_WIDE) ? 1.0f : 0.0f;
}
}

void EV_EgonStop(event_args_t* args)
Expand Down Expand Up @@ -1425,26 +1423,6 @@ void EV_EgonStop(event_args_t* args)
pBeam2 = NULL;
}

if (pFlare) // Vit_amiN: egon beam flare
{
pFlare->die = gEngfuncs.GetClientTime();

if (gEngfuncs.GetMaxClients() == 1 || (pFlare->flags & FTENT_NOMODEL) == 0)
{
if (pFlare->tentOffset.x != 0.0f) // true for iFireMode == FIRE_WIDE
{
pFlare->callback = &EV_EgonFlareCallback;
pFlare->fadeSpeed = 2.0; // fade out will take 0.5 sec
pFlare->tentOffset.x = 10.0; // scaling speed per second
pFlare->tentOffset.y = 0.1; // min time between two scales
pFlare->tentOffset.z = pFlare->die; // the last callback run time
pFlare->flags = FTENT_FADEOUT | FTENT_CLIENTCUSTOM;
}
}

pFlare = NULL;
}

// HACK: only reset animation if the Egon is still equipped.
if (g_CurrentWeaponId == WEAPON_EGON)
{
Expand Down
8 changes: 6 additions & 2 deletions cl_dll/geiger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ bool CHudGeiger::Draw(float flTime)
int rg[3];
int i;

if (m_iGeigerRange <= 800 && m_iGeigerRange > 0)
if (m_iGeigerRange < 1000 && m_iGeigerRange > 0)
{
// peicewise linear is better than continuous formula for this
if (m_iGeigerRange > 600)
if (m_iGeigerRange > 800)
{
pct = 0; // Con_Printf ( "range > 800\n");
}
else if (m_iGeigerRange > 600)
{
pct = 2;
flvol = 0.4; //Con_Printf ( "range > 600\n");
Expand Down
Loading

0 comments on commit d53e3a4

Please sign in to comment.