Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Feb 4, 2023
2 parents 594e93a + 6ecc8f2 commit 88282c2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ All changes from Half-Life Updated up until Beta 5 are included: https://github.
* Added `-flifetime-dse=1` flag to Linux Makefile to disable compiler optimization that removed entity memory zero-initialization, resulting in the game crashing when any entity touches the world [#187](https://github.com/SamVanheer/halflife-updated/issues/187)(Thanks FreeSlave)
* Fixed game_player_equip crashing when given a null activator [#189](https://github.com/SamVanheer/halflife-updated/issues/189)
* Fixed Hornet gun recharging to full ammo after loading a save game [#190](https://github.com/SamVanheer/halflife-updated/issues/190)
* Fixed explosives that impact the underside of a brush dealing damage to entities on the other side of that brush (halflife issue [#3244](https://github.com/ValveSoftware/halflife/issues/3244))
* Fixed entities with an index greater than 2047 corrupting the client's heap if sent over the network [#191](https://github.com/SamVanheer/halflife-updated/issues/191)

### New features

* Save and restore game_player_equip [#188](https://github.com/SamVanheer/halflife-updated/issues/188)
* Moved IsFacing function from barney.cpp to h_ai.cpp to help prevent linker errors when copy pasting source file
* When using `impulse 107` to get the name of a texture the texture type (as used in `materials.txt`) will also be printed
* Made `PM_FindTextureType` const correct
* Added `WRITE_FLOAT` function corresponding to the client's `READ_FLOAT` function
* Set maximum edicts to 2048 in liblist.gam [#181](https://github.com/SamVanheer/halflife-updated/issues/181)

## Changes in V1.0.0 Beta 013

Expand Down
2 changes: 1 addition & 1 deletion common/com_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define STUDIO_RENDER 1
#define STUDIO_EVENTS 2

#define MAX_EDICTS 900
#define MAX_EDICTS 2048

#define MAX_MODEL_NAME 64
#define MAX_MAP_HULLS 4
Expand Down
10 changes: 10 additions & 0 deletions dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "com_model.h"
#include "saverestore.h"
#include "player.h"
#include "spectator.h"
Expand Down Expand Up @@ -1084,6 +1085,15 @@ we could also use the pas/ pvs that we set in SetupVisibility, if we wanted to.
*/
int AddToFullPack(struct entity_state_s* state, int e, edict_t* ent, edict_t* host, int hostflags, int player, unsigned char* pSet)
{
// Entities with an index greater than this will corrupt the client's heap because
// the index is sent with only 11 bits of precision (2^11 == 2048).
// So we don't send them, just like having too many entities would result
// in the entity not being sent.
if (e >= MAX_EDICTS)
{
return 0;
}

int i;

auto entity = reinterpret_cast<CBaseEntity*>(GET_PRIVATE(ent));
Expand Down
6 changes: 6 additions & 0 deletions dlls/enginecallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float* pOrigin = NUL
#define WRITE_COORD (*g_engfuncs.pfnWriteCoord)
#define WRITE_STRING (*g_engfuncs.pfnWriteString)
#define WRITE_ENTITY (*g_engfuncs.pfnWriteEntity)

inline void WRITE_FLOAT(float value)
{
WRITE_LONG(*reinterpret_cast<int*>(&value));
}

#define CVAR_REGISTER (*g_engfuncs.pfnCVarRegister)
#define CVAR_GET_FLOAT (*g_engfuncs.pfnCVarGetFloat)
#define CVAR_GET_STRING (*g_engfuncs.pfnCVarGetString)
Expand Down
6 changes: 5 additions & 1 deletion dlls/ggrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ void CGrenade::Explode(TraceResult* pTrace, int bitsDamageType)

pev->owner = NULL; // can't traceline attack owner if this is set

RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, bitsDamageType);
// Counteract the + 1 in RadiusDamage.
Vector origin = pev->origin;
origin.z -= 1;

RadiusDamage(origin, pev, pevOwner, pev->dmg, CLASS_NONE, bitsDamageType);

if (RANDOM_FLOAT(0, 1) < 0.5)
{
Expand Down

0 comments on commit 88282c2

Please sign in to comment.