Skip to content

Commit

Permalink
Merge branch 'spirit/spirit-1.1' into spirit/spirit-1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LogicAndTrick committed Sep 2, 2024
2 parents 5330c44 + 3781e53 commit 2ec53cc
Show file tree
Hide file tree
Showing 189 changed files with 40,544 additions and 16,733 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,7 +1,6 @@
.vs/

# 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
53 changes: 51 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,60 @@

## 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
5 changes: 4 additions & 1 deletion 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 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 Expand Up @@ -43,6 +43,7 @@ Fixes for bugs introduced in beta builds are not included in this list.
* Fixed player weapons still receiving input when starting to use a func_tank (halflife issue [#3345](https://github.com/ValveSoftware/halflife/issues/3345)) (Thanks Oxofemple.)
* Fixed limit in world weapons (e.g. Hand Grenade) respawning at wrong time if server is near edict limit
* Disabled fall think function for weapons when the player picks it up to prevent possible double-pickup which removes the weapon and crashes the game
* Fixed weapon events not treating pushable objects as BSP models [#220](https://github.com/twhl-community/halflife-updated/pull/220) (Thanks Toodles2You)

### Crowbar

Expand All @@ -51,6 +52,7 @@ Fixes for bugs introduced in beta builds are not included in this list.
* Fixed crowbar not showing in weapon list if there are empty weapon slots with a lower id (halflife [#3181](https://github.com/ValveSoftware/halflife/issues/3181))
* Fixed the Crowbar damage always being calculated halved (halflife issue [#1600](https://github.com/ValveSoftware/halflife/pull/1600) (Thanks YaLTeR)
* Fixed Crowbar playing back swing events twice sometimes (halflife issue [#3230](https://github.com/ValveSoftware/halflife/issues/3230))
* Fixed crowbar applying breakable glass decals to unbreakable pushable objects [#219](https://github.com/twhl-community/halflife-updated/pull/219) (Thanks Toodles2You)

### Glock

Expand Down Expand Up @@ -116,6 +118,7 @@ Fixes for bugs introduced in beta builds are not included in this list.
* Fixed Hand grenade not playing deploy animation after finishing a throw (halflife issue [#2495](https://github.com/ValveSoftware/halflife/issues/2495))
* Fixed Hand grenades staying primed when switching away or dropping the weapon (halflife issue [#3251](https://github.com/ValveSoftware/halflife/issues/3251))
* Fixed hand grenade animations not playing correctly [#209](https://github.com/twhl-community/halflife-updated/pull/209) (Thanks Toodles2You)
* Reset frame to 0 when grenade bounces [#238](https://github.com/twhl-community/halflife-updated/issues/238) (Thanks FreeSlave)

### Satchel charge

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
59 changes: 43 additions & 16 deletions cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ void WeaponsResource::LoadWeaponSprites(WEAPON* pWeapon)
{
int i, iRes;

if (ScreenWidth < 640)
iRes = 320;
else
if (ScreenWidth > 2560 && ScreenHeight > 1600)
iRes = 2560;
else if (ScreenWidth >= 1280 && ScreenHeight > 720)
iRes = 1280;
else if (ScreenWidth >= 640)
iRes = 640;
else
iRes = 320;

char sz[256];

Expand Down Expand Up @@ -323,16 +327,17 @@ bool CHudAmmo::VidInit()
// If we've already loaded weapons, let's get new sprites
gWR.LoadAllWeaponSprites();

if (ScreenWidth >= 640)
{
giABWidth = 20;
giABHeight = 4;
}
else
{
giABWidth = 10;
giABHeight = 2;
}
int nScale = 1;

if (ScreenWidth > 2560 && ScreenHeight > 1600)
nScale = 4;
else if (ScreenWidth >= 1280 && ScreenHeight > 720)
nScale = 3;
else if (ScreenWidth >= 640)
nScale = 2;

giABWidth = 10 * nScale;
giABHeight = 2 * nScale;

return true;
}
Expand Down Expand Up @@ -657,7 +662,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 @@ -675,6 +681,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 Expand Up @@ -890,8 +917,8 @@ bool CHudAmmo::Draw(float flTime)

ScaleColors(r, g, b, a);

// Does this weapon have a clip?
y = ScreenHeight - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
y += (int)(gHUD.m_iFontHeight * 0.2f);

// Does weapon have any ammo at all?
if (m_pWeapon->iAmmoType > 0)
Expand Down Expand Up @@ -1206,7 +1233,7 @@ client_sprite_t* GetSpriteList(client_sprite_t* pList, const char* psz, int iRes

while (0 != i--)
{
if ((0 == strcmp(psz, p->szName)) && (p->iRes == iRes))
if ((p->iRes == iRes) && (0 == strcmp(psz, p->szName)))
return p;
p++;
}
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ammohistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ bool HistoryResource::DrawAmmoHistory(float flTime)

// Draw the pic
int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i));
int xpos = ScreenWidth - 24;
int xpos = ScreenWidth - (rcPic.right - rcPic.left) - 4;
if (spr && 0 != *spr) // weapon isn't loaded yet so just don't draw the pic
{ // the dll has to make sure it has sent info the weapons you need
SPR_Set(*spr, r, g, b);
Expand Down
9 changes: 7 additions & 2 deletions cl_dll/battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ bool CHudBattery::Draw(float flTime)
int iOffset = (m_prc1->bottom - m_prc1->top) / 6;

y = ScreenHeight - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
x = ScreenWidth / 4;

int width = (m_prc1->right - m_prc1->left);

// this used to just be ScreenWidth/5 (4 on Updated) but that caused real issues at higher resolutions. Instead, base it on the width of this sprite.
x = 3 * width;

// make sure we have the right sprite handles
if (0 == m_hSprite1)
Expand All @@ -130,7 +134,8 @@ bool CHudBattery::Draw(float flTime)
SPR_DrawAdditive(0, x, y - iOffset + (rc.top - m_prc2->top), &rc);
}

x += (m_prc1->right - m_prc1->left);
x += width;
y += (int)(gHUD.m_iFontHeight * 0.2f);
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b);

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
19 changes: 13 additions & 6 deletions 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 All @@ -101,7 +101,12 @@ bool CHudDeathNotice::VidInit()

bool CHudDeathNotice::Draw(float flTime)
{
int x, y, r, g, b;
int x, y, r, g, b, texty;

int gap = 20;

Rect sprite = gHUD.GetSpriteRect(m_HUD_d_skull);
gap = sprite.bottom - sprite.top;

for (int i = 0; i < MAX_DEATHNOTICES; i++)
{
Expand All @@ -122,10 +127,12 @@ bool CHudDeathNotice::Draw(float flTime)
if (gViewPort && gViewPort->AllowedToPrintText())
{
// Draw the death notice
y = DEATHNOTICE_TOP + 2 + (20 * i); //!!!
y = DEATHNOTICE_TOP + 2 + (gap * i);

texty = y + 4;

int id = (rgDeathNoticeList[i].iId == -1) ? m_HUD_d_skull : rgDeathNoticeList[i].iId;
x = ScreenWidth - ConsoleStringLen(rgDeathNoticeList[i].szVictim) - (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left);
x = ScreenWidth - ConsoleStringLen(rgDeathNoticeList[i].szVictim) - (gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left) - 4;

if (!rgDeathNoticeList[i].iSuicide)
{
Expand All @@ -134,7 +141,7 @@ bool CHudDeathNotice::Draw(float flTime)
// Draw killers name
if (rgDeathNoticeList[i].KillerColor)
gEngfuncs.pfnDrawSetTextColor(rgDeathNoticeList[i].KillerColor[0], rgDeathNoticeList[i].KillerColor[1], rgDeathNoticeList[i].KillerColor[2]);
x = 5 + DrawConsoleString(x, y, rgDeathNoticeList[i].szKiller);
x = 5 + DrawConsoleString(x, texty, rgDeathNoticeList[i].szKiller);
}

r = 255;
Expand All @@ -158,7 +165,7 @@ bool CHudDeathNotice::Draw(float flTime)
{
if (rgDeathNoticeList[i].VictimColor)
gEngfuncs.pfnDrawSetTextColor(rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2]);
x = DrawConsoleString(x, y, rgDeathNoticeList[i].szVictim);
x = DrawConsoleString(x, texty, rgDeathNoticeList[i].szVictim);
}
}
}
Expand Down
Loading

0 comments on commit 2ec53cc

Please sign in to comment.