Skip to content

Commit

Permalink
game: fix items spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
0lvin committed Dec 14, 2024
1 parent b6fa2da commit da77d05
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
33 changes: 33 additions & 0 deletions src/common/header/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,39 @@ typedef struct entity_xstate_s
/* events only go out for a single frame, they */
/* are automatically cleared each frame */

short clientnum; // In Quake 2, the client num was passed in skinnum. We need this value, however.

// For specific path to skin.

char skinname[MAX_QPATH];

// EF_XXX.

// What's this exactly?
byte color[4];

// For looping sounds, so we can set volume and attenuation.
byte sound_data;

// required so we can place sounds for bmodels correctly in 3d space
vec3_t bmodel_origin;

// Header block for list of all client effects attatched to this entity.
EffectsBuffer_t clientEffects;

// Specifies which parts (nodes) of the model are on/off, node colors etc.

fmnodeinfo_t fmnodeinfo[MAX_FM_MESH_NODES];

// Skeletal info. Only relevant for player models (i.e. have U_JOINTED).
short skeletalType;
short rootJoint;

short swapFrame;

// Used by the client to verify is this still the same entity it last had.
byte usageCount;

/* New protocol fields, sync with entity_rrstate_t */
vec3_t scale; /* model scale */
unsigned int rreffects;
Expand Down
3 changes: 2 additions & 1 deletion src/game/effects/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ static void
AddServerEntities(frame_t *frame)
{
entity_t *ent;
entity_state_t *s1;
float autorotate, macerotate;
int i;
int pnum;
Expand Down Expand Up @@ -603,6 +602,8 @@ AddServerEntities(frame_t *frame)

for(pnum = 0, ent = sv_ents; pnum<numEntsToAdd; ++pnum)
{
entity_xstate_t *s1;

s1 = &fxi.parse_entities[(frame->parse_entities +
pnum) & (MAX_PARSE_ENTITIES - 1)];

Expand Down
3 changes: 3 additions & 0 deletions src/game/g_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,9 @@ SpawnItem(edict_t *ent, gitem_t *item)
if ((ent->spawnflags & ITEM_COOP_ONLY) && (!coop->value))
return;

/* RREXTEND: Reset dynamic model assign */
ent->s.modelindex = 0;

PrecacheItem(item);

if(!ValidItem(item))
Expand Down
2 changes: 1 addition & 1 deletion src/game/header/client_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef struct

// Buffer into which net stuff is parsed.

entity_state_t *parse_entities;
entity_xstate_t *parse_entities;

sizebuf_t *net_message;
float *PlayerAlpha;
Expand Down

0 comments on commit da77d05

Please sign in to comment.