// 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);