From b4b94ef8c28c401fc4164688438aac71fdf31c04 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 26 Sep 2011 20:50:29 +0000 Subject: [PATCH 1/1] detect if items2 field was declared in the quakec rather than checking if GAME_HIPNOTIC or GAME_ROGUE because that prevented existing quake server mods from abusing the runes on the quake hud git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11371 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sv_main.c b/sv_main.c index c60e15b0..d7cee094 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1978,7 +1978,10 @@ void SV_WriteClientdataToMessage (client_t *client, prvm_edict_t *ent, sizebuf_t // stuff the sigil bits into the high bits of items for sbar, or else // mix in items2 - if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE) + // LordHavoc: detecting items2 turned out to be tricky, check if the field + // was forcefully declared, we want to override serverflags if it was + // declared by the qc intentionally, but not if we added it in the engine. + if (prog->fieldoffsets.items2 < (int)(prog->numfielddefs - SV_REQGLOBALS)) items = (int)PRVM_serveredictfloat(ent, items) | ((int)PRVM_serveredictfloat(ent, items2) << 23); else items = (int)PRVM_serveredictfloat(ent, items) | ((int)PRVM_serverglobalfloat(serverflags) << 28); -- 2.39.2