Skip to content

Commit

Permalink
Merge remote-tracking branch 'Half-LifeUpdated/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelTroch committed Aug 12, 2024
2 parents 97b5412 + 78575b9 commit 06841b3
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ Can't be fixed:
### 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)

## Changes in V1.0.0

Expand Down
3 changes: 3 additions & 0 deletions FULL_UPDATED_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,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 @@ -192,6 +193,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 @@ -257,6 +259,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
29 changes: 16 additions & 13 deletions cl_dll/ev_hldm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ void V_PunchAxis(int axis, float punch);
void VectorAngles(const float* forward, float* angles);

extern cvar_t* cl_lw;
extern cvar_t* r_decals;

static inline bool EV_HLDM_IsBSPModel(physent_t* pe)
{
return pe != nullptr && (pe->solid == SOLID_BSP || pe->movetype == MOVETYPE_PUSHSTEP);
}

// play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the
// original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture.
Expand Down Expand Up @@ -226,6 +232,9 @@ char* EV_HLDM_DamageDecal(physent_t* pe)
static char decalname[32];
int idx;

if (pe->rendermode == kRenderTransAlpha)
return nullptr;

if (pe->classnumber == 1)
{
idx = gEngfuncs.pfnRandomLong(0, 2);
Expand All @@ -246,7 +255,6 @@ char* EV_HLDM_DamageDecal(physent_t* pe)
void EV_HLDM_GunshotDecalTrace(pmtrace_t* pTrace, char* decalName)
{
int iRand;
physent_t* pe;

gEngfuncs.pEfxAPI->R_BulletImpactParticles(pTrace->endpos);

Expand All @@ -273,17 +281,12 @@ void EV_HLDM_GunshotDecalTrace(pmtrace_t* pTrace, char* decalName)
}
}

pe = gEngfuncs.pEventAPI->EV_GetPhysent(pTrace->ent);

// Only decal brush models such as the world etc.
if (decalName && '\0' != decalName[0] && pe && (pe->solid == SOLID_BSP || pe->movetype == MOVETYPE_PUSHSTEP))
if (decalName && '\0' != decalName[0] && r_decals->value > 0)
{
if (CVAR_GET_FLOAT("r_decals"))
{
gEngfuncs.pEfxAPI->R_DecalShoot(
gEngfuncs.pEfxAPI->Draw_DecalIndex(gEngfuncs.pEfxAPI->Draw_DecalIndexFromName(decalName)),
gEngfuncs.pEventAPI->EV_IndexFromTrace(pTrace), 0, pTrace->endpos, 0);
}
gEngfuncs.pEfxAPI->R_DecalShoot(
gEngfuncs.pEfxAPI->Draw_DecalIndex(gEngfuncs.pEfxAPI->Draw_DecalIndexFromName(decalName)),
gEngfuncs.pEventAPI->EV_IndexFromTrace(pTrace), 0, pTrace->endpos, 0);
}
}

Expand All @@ -293,7 +296,7 @@ void EV_HLDM_DecalGunshot(pmtrace_t* pTrace, int iBulletType)

pe = gEngfuncs.pEventAPI->EV_GetPhysent(pTrace->ent);

if (pe && pe->solid == SOLID_BSP)
if (EV_HLDM_IsBSPModel(pe))
{
switch (iBulletType)
{
Expand Down Expand Up @@ -968,7 +971,7 @@ void EV_FireGauss(event_args_t* args)
if (pEntity == NULL)
break;

if (pEntity->solid == SOLID_BSP)
if (EV_HLDM_IsBSPModel(pEntity))
{
float n;

Expand Down Expand Up @@ -1219,7 +1222,7 @@ void EV_FireCrossbow2(event_args_t* args)
physent_t* pe = gEngfuncs.pEventAPI->EV_GetPhysent(tr.ent);

//Not the world, let's assume we hit something organic ( dog, cat, uncle joe, etc ).
if (pe->solid != SOLID_BSP)
if (!EV_HLDM_IsBSPModel(pe))
{
switch (gEngfuncs.pfnRandomLong(0, 1))
{
Expand Down
2 changes: 2 additions & 0 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ cvar_t* cl_lw = NULL;
cvar_t* cl_rollangle = nullptr;
cvar_t* cl_rollspeed = nullptr;
cvar_t* cl_bobtilt = nullptr;
cvar_t* r_decals = nullptr;

void ShutdownInput();

Expand Down Expand Up @@ -393,6 +394,7 @@ void CHud::Init()
cl_rollangle = CVAR_CREATE("cl_rollangle", "2.0", FCVAR_ARCHIVE);
cl_rollspeed = CVAR_CREATE("cl_rollspeed", "200", FCVAR_ARCHIVE);
cl_bobtilt = CVAR_CREATE("cl_bobtilt", "0", FCVAR_ARCHIVE);
r_decals = gEngfuncs.pfnGetCvarPointer("r_decals");

m_pSpriteList = NULL;

Expand Down
10 changes: 10 additions & 0 deletions dlls/func_break.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ class CPushable : public CBreakable
// breakables use an overridden takedamage
bool TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType) override;

int DamageDecal(int bitsDamageType) override;

static TYPEDESCRIPTION m_SaveData[];

static const char* m_soundNames[3];
Expand Down Expand Up @@ -1030,3 +1032,11 @@ bool CPushable::TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, floa

return true;
}

int CPushable::DamageDecal(int bitsDamageType)
{
if (FBitSet(pev->spawnflags, SF_PUSH_BREAKABLE))
return CBreakable::DamageDecal(bitsDamageType);

return CBaseEntity::DamageDecal(bitsDamageType);
}
3 changes: 3 additions & 0 deletions dlls/ggrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ void CGrenade::BounceTouch(CBaseEntity* pOther)
if (pev->framerate > 1.0)
pev->framerate = 1;
else if (pev->framerate < 0.5)
{
pev->framerate = 0;
pev->frame = 0;
}
}


Expand Down

0 comments on commit 06841b3

Please sign in to comment.