From 6cf7335db512cce5da0dd98eff266d3684ac7e01 Mon Sep 17 00:00:00 2001 From: Reki Date: Fri, 21 May 2021 15:27:53 -0400 Subject: [PATCH] Added saveflags to stop classes from yeeting save files --- protocol.h | 2 ++ prvm_edict.c | 4 +++- prvm_offsets.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/protocol.h b/protocol.h index 8d5849c6..20403883 100644 --- a/protocol.h +++ b/protocol.h @@ -744,6 +744,8 @@ void EntityFrame4_CL_ReadFrame(void); //CSQC Flags #define CSQCFLAG_SOLIDITY (1<<0) +//Save Flags (these shouldn't be here but I don't know where to put them, sorry) +#define SAVEFLAG_DONTSAVE (1<<0) // reset all entity fields (typically used if status changed) #define E5_FULLUPDATE (1<<0) diff --git a/prvm_edict.c b/prvm_edict.c index 3c50397e..8f33cf49 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -734,10 +734,12 @@ void PRVM_ED_Write (prvm_prog_t *prog, qfile_t *f, prvm_edict_t *ed) int type; char vabuf[1024]; char valuebuf[MAX_INPUTLINE]; + + int saveflags = (int)(PRVM_serveredictfloat(ed, saveflags)); FS_Print(f, "{\n"); - if (ed->priv.required->free) + if (ed->priv.required->free || saveflags & SAVEFLAG_DONTSAVE) { FS_Print(f, "}\n"); return; diff --git a/prvm_offsets.h b/prvm_offsets.h index 61210039..fb53c24f 100644 --- a/prvm_offsets.h +++ b/prvm_offsets.h @@ -377,6 +377,7 @@ PRVM_DECLARE_field(solid) PRVM_DECLARE_field(sounds) PRVM_DECLARE_field(spawnflags) PRVM_DECLARE_field(style) +PRVM_DECLARE_field(saveflags) PRVM_DECLARE_field(tag_entity) PRVM_DECLARE_field(tag_index) PRVM_DECLARE_field(takedamage) @@ -727,6 +728,7 @@ PRVM_DECLARE_serverfieldfloat(solid) PRVM_DECLARE_serverfieldfloat(sounds) PRVM_DECLARE_serverfieldfloat(spawnflags) PRVM_DECLARE_serverfieldfloat(style) +PRVM_DECLARE_serverfieldfloat(saveflags) PRVM_DECLARE_serverfieldfloat(tag_index) PRVM_DECLARE_serverfieldfloat(takedamage) PRVM_DECLARE_serverfieldfloat(team) -- 2.39.2