From: havoc Date: Mon, 26 Sep 2011 20:50:29 +0000 (+0000) Subject: detect if items2 field was declared in the quakec rather than checking X-Git-Tag: xonotic-v0.6.0~163^2~181 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=b4b94ef8c28c401fc4164688438aac71fdf31c04;hp=119cbafe56ebbac24781cd5526d200e443327267 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 --- 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);