Skip to content

Commit

Permalink
engine: server: hack save fields that use types unsupported by Half-L…
Browse files Browse the repository at this point in the history
…ife Unified SDK through array types
  • Loading branch information
a1batross committed Dec 25, 2024
1 parent 6469b0a commit 65750f0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions engine/server/sv_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ static TYPEDESCRIPTION gSaveClient[] =
DEFINE_ARRAY( SAVE_CLIENT, introTrack, FIELD_CHARACTER, 64 ),
DEFINE_ARRAY( SAVE_CLIENT, mainTrack, FIELD_CHARACTER, 64 ),
DEFINE_FIELD( SAVE_CLIENT, trackPosition, FIELD_INTEGER ),
DEFINE_FIELD( SAVE_CLIENT, viewentity, FIELD_SHORT ),
// mods based on HLU SDK disallow usage of FIELD_SHORT
DEFINE_ARRAY( SAVE_CLIENT, viewentity, FIELD_CHARACTER, sizeof( short )),
DEFINE_FIELD( SAVE_CLIENT, wateralpha, FIELD_FLOAT ),
DEFINE_FIELD( SAVE_CLIENT, wateramp, FIELD_FLOAT ),
};
Expand All @@ -150,14 +151,16 @@ static TYPEDESCRIPTION gDecalEntry[] =
{
DEFINE_FIELD( decallist_t, position, FIELD_VECTOR ),
DEFINE_ARRAY( decallist_t, name, FIELD_CHARACTER, 64 ),
DEFINE_FIELD( decallist_t, entityIndex, FIELD_SHORT ),
// mods based on HLU SDK disallow usage of FIELD_SHORT
DEFINE_ARRAY( decallist_t, entityIndex, FIELD_CHARACTER, sizeof( short )),
DEFINE_FIELD( decallist_t, depth, FIELD_CHARACTER ),
DEFINE_FIELD( decallist_t, flags, FIELD_CHARACTER ),
DEFINE_FIELD( decallist_t, scale, FIELD_FLOAT ),
DEFINE_FIELD( decallist_t, impactPlaneNormal, FIELD_VECTOR ),
DEFINE_ARRAY( decallist_t, studio_state, FIELD_CHARACTER, sizeof( modelstate_t )),
};

// Can use any FIELD type here because only Xash3D games will spawn static entities
static TYPEDESCRIPTION gStaticEntry[] =
{
DEFINE_FIELD( entity_state_t, messagenum, FIELD_MODELNAME ), // HACKHACK: store model into messagenum
Expand Down Expand Up @@ -200,7 +203,8 @@ static TYPEDESCRIPTION gStaticEntry[] =
static TYPEDESCRIPTION gSoundEntry[] =
{
DEFINE_ARRAY( soundlist_t, name, FIELD_CHARACTER, 64 ),
DEFINE_FIELD( soundlist_t, entnum, FIELD_SHORT ),
// mods based on HLU SDK disallow usage of FIELD_SHORT
DEFINE_ARRAY( soundlist_t, entnum, FIELD_CHARACTER, sizeof( short )),
DEFINE_FIELD( soundlist_t, origin, FIELD_VECTOR ),
DEFINE_FIELD( soundlist_t, volume, FIELD_FLOAT ),
DEFINE_FIELD( soundlist_t, attenuation, FIELD_FLOAT ),
Expand Down

0 comments on commit 65750f0

Please sign in to comment.