23 if (e.projectiledeathtype)
27 if(e.flags & FL_PROJECTILE)
46 void generic_setactive(
entity this,
int act)
65 void generic_netlinked_setactive(
entity this,
int act)
67 int old_status = this.
active;
68 generic_setactive(
this, act);
70 if (this.
active != old_status)
76 void generic_netlinked_reset(
entity this)
104 bool autocvar_g_triggers_debug =
true;
106 void trigger_init(
entity this)
108 string m = this.
model;
110 if(autocvar_g_triggers_debug)
119 setsize(
this, this.
mins * this.
scale, this.
maxs * this.scale);
121 setsize(
this, this.
mins, this.
maxs);
124 if(autocvar_g_triggers_debug)
131 this.SendFlags = 0xFFFFFF;
134 void trigger_common_write(
entity this,
bool withtarget)
139 if(this.
origin !=
'0 0 0')
143 if(this.
angles !=
'0 0 0')
160 if(targbits &
BIT(0))
162 if(targbits &
BIT(1))
164 if(targbits &
BIT(2))
166 if(targbits &
BIT(3))
168 if(targbits &
BIT(4))
170 if(targbits &
BIT(5))
175 WriteVector(MSG_ENTITY, this.
origin);
178 WriteVector(MSG_ENTITY, this.
movedir);
181 WriteVector(MSG_ENTITY, this.
angles);
184 WriteVector(MSG_ENTITY, this.
mins);
185 WriteVector(MSG_ENTITY, this.
maxs);
191 void trigger_common_read(
entity this,
bool withtarget)
205 int targbits = ReadByte();
216 this.
origin = ReadVector();
227 this.
angles = ReadVector();
232 this.
mins = ReadVector();
233 this.
maxs = ReadVector();
234 this.
scale = ReadByte() / 16;
235 setsize(
this, this.
mins, this.
maxs);
238 void trigger_remove_generic(
entity this)
284 if(!(skiptargets &
BIT(1))) t.target = this.
target;
285 if(!(skiptargets &
BIT(2))) t.target2 = this.
target2;
286 if(!(skiptargets &
BIT(3))) t.target3 = this.
target3;
287 if(!(skiptargets &
BIT(4))) t.target4 = this.
target4;
303 if (this.
noise ==
"")
304 play2(actor,
SND(TALK));
325 for(
int i = 0; i < 4; ++i)
327 if(skiptargets &
BIT(i + 1))
332 case 0: s = this.
target;
break;
333 case 1: s = this.
target2;
break;
334 case 2: s = this.
target3;
break;
335 case 3: s = this.
target4;
break;
341 if(t !=
this && t.use && (t.sub_target_used !=
time || !preventReuse))
349 t.use(t, actor,
this);
351 t.sub_target_used =
time;
void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger)
void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventReuse, int skiptargets)
void DelayThink(entity this)
#define EXACTTRIGGER_INIT
ERASEABLE void RandomSelection_Init()
void SUB_UseTargets_SkipTargets(entity this, entity actor, entity trigger, int skiptargets)
void SUB_UseTargets(entity this, entity actor, entity trigger)
const float EF_NODEPTHTEST
void SUB_DontUseTargets(entity this, entity actor, entity trigger)
#define BITSET_ASSIGN(a, b)
#define IS_REAL_CLIENT(v)
#define RandomSelection_AddEnt(e, weight, priority)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
entity RandomSelection_chosen_ent
#define setSendEntity(e, f)
#define new_pure(class)
purely logical entities (.origin doesn't work)
bool Item_IsLoot(entity item)
Returns whether the item is loot.
bool isPushable(entity e)
const int SF_TRIGGER_UPDATE