28 error(
"StatusEffects_groups_minor is not a multiple of 8.");
31 error(sprintf(
"StatusEffects_groups_major can not be < %d.", min_major_value));
36#define G_MAJOR(id) (floor((id) / StatusEffects_groups_minor))
37#define G_MINOR(id) ((id) % StatusEffects_groups_minor)
55 if (!(majorBits &
BIT(i))) {
60 if (!(minorBits &
BIT(j))) {
87 .float fld = statuseffect_time[it.m_id];
88 .int flg = statuseffect_flags[it.m_id];
89 const bool changed = (store.(fld) != data.(fld) || store.(flg) != data.(flg));
90 store.(fld) = data.(fld);
91 store.(flg) = data.(flg);
94 majorBits =
BITSET(majorBits,
BIT(maj),
true);
102 if (!(majorBits &
BIT(i)))
109 if (!(minorBits &
BIT(j)))
135 return (client.statuseffects ==
this);
163 store.statuseffect_time[it.m_id] = 0;
164 store.statuseffect_flags[it.m_id] = 0;
#define REGISTER_MUTATOR(...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
#define BITSET(var, mask, flag)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int statuseffect_flags[REGISTRY_MAX(StatusEffects)]
float statuseffect_time[REGISTRY_MAX(StatusEffects)]
Stores times of status effects, the id being the index.
#define FOREACH(list, cond, body)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
#define REGISTER_NET_LINKED(id)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
#define make_pure(e)
direct use is
#define REGISTRY_COUNT(id)
#define REGISTRY_GET(id, i)
#define STATIC_INIT(func)
during worldspawn
bool StatusEffects_Send(StatusEffect this, entity to, int sf)
void StatusEffects_removeall(entity actor, int removal_type)
void StatusEffectsStorage_attach(entity e)
void StatusEffects_remove(StatusEffect this, entity actor, int removal_type)
StatusEffect g_statuseffects
void StatusEffects_new(entity this)
const int StatusEffects_groups_minor
int SEFminorBitsArr[StatusEffects_groups_major]
void StatusEffects_Write(StatusEffect data, StatusEffect store)
StatusEffect statuseffects
Entity statuseffects.
void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
void StatusEffects_entremove(entity this)
float StatusEffects_gettime(StatusEffect this, entity actor)
const int StatusEffects_groups_major
bool StatusEffects_customize(entity this, entity client)
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_update(entity e)
StatusEffect statuseffects_store
Player statuseffects storage (holds previous state)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
void StatusEffects_delete(entity e)
void StatusEffectsStorage_delete(entity e)
void StatusEffects_clearall(entity store)
void ONREMOVE(entity this)
void StatusEffects_tick(entity actor)