}
string formatmessage(string msg)
-{
+{SELFPARAM();
float p, p1, p2;
float n;
vector cursor;
>0: receives a cvar from name=argv(f) value=argv(f+1)
*/
void GetCvars_handleString(string thisname, float f, .string field, string name)
-{
+{SELFPARAM();
if (f < 0)
{
if (self.(field))
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
void GetCvars_handleString_Fixup(string thisname, float f, .string field, string name, string(string) func)
-{
+{SELFPARAM();
GetCvars_handleString(thisname, f, field, name);
if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
if (thisname == name)
}
}
void GetCvars_handleFloat(string thisname, float f, .float field, string name)
-{
+{SELFPARAM();
if (f < 0)
{
}
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
void GetCvars_handleFloatOnce(string thisname, float f, .float field, string name)
-{
+{SELFPARAM();
if (f < 0)
{
}
}
}
string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
-{
+{SELFPARAM();
string o;
o = W_FixWeaponOrder_ForceComplete(wo);
if(self.weaponorder_byimpulse)
return o;
}
void GetCvars(float f)
-{
+{SELFPARAM();
string s = string_null;
if (f > 0)
}
void precache()
-{
+{SELFPARAM();
// gamemode related things
precache_model ("models/misc/chatbubble.spr");
precache_model("models/ice/ice.md3");
}
void objerror(string s)
-{
+{SELFPARAM();
make_safe_for_remove(self);
builtin_objerror(s);
}
if (!e || e.initialize_entity)
{
// make a proxy initializer entity
- entity e_old;
- e_old = e;
- e = spawn();
- e.classname = "initialize_entity";
+ entity e_old = e;
+ e = new(initialize_entity);
e.enemy = e_old;
}
}
}
void InitializeEntitiesRun()
-{
- entity startoflist;
- startoflist = initialize_entity_first;
- initialize_entity_first = world;
+{SELFPARAM();
+ entity startoflist = initialize_entity_first;
+ initialize_entity_first = NULL;
remove = remove_except_protected;
- for (self = startoflist; self; self = self.initialize_entity_next)
+ for (entity e = startoflist; e; e = e.initialize_entity_next)
{
- self.remove_except_protected_forbidden = 1;
+ e.remove_except_protected_forbidden = 1;
}
- for (self = startoflist; self; )
+ for (entity e = startoflist; e; )
{
- entity e;
- var void(void) func;
- e = self.initialize_entity_next;
- func = self.initialize_entity;
- self.initialize_entity_order = 0;
- self.initialize_entity = func_null;
- self.initialize_entity_next = world;
- self.remove_except_protected_forbidden = 0;
- if (self.classname == "initialize_entity")
+ e.remove_except_protected_forbidden = 0;
+ e.initialize_entity_order = 0;
+ entity next = e.initialize_entity_next;
+ e.initialize_entity_next = NULL;
+ var void() func = e.initialize_entity;
+ e.initialize_entity = func_null;
+ if (e.classname == "initialize_entity")
+ {
+ entity wrappee = e.enemy;
+ builtin_remove(e);
+ e = wrappee;
+ }
+ //dprint("Delayed initialization: ", e.classname, "\n");
+ if (func)
{
- entity e_old;
- e_old = self.enemy;
- builtin_remove(self);
- self = e_old;
+ WITH(entity, self, e, func());
}
- //dprint("Delayed initialization: ", self.classname, "\n");
- if(func)
- func();
else
{
- eprint(self);
- backtrace(strcat("Null function in: ", self.classname, "\n"));
+ eprint(e);
+ backtrace(strcat("Null function in: ", e.classname, "\n"));
}
- self = e;
+ e = next;
}
remove = remove_unsafely;
}
void UncustomizeEntitiesRun()
-{
- entity oldself;
- oldself = self;
- for (self = world; (self = findfloat(self, uncustomizeentityforclient_set, 1)); )
- self.uncustomizeentityforclient();
- self = oldself;
+{SELFPARAM();
+ for (entity e = NULL; (e = findfloat(e, uncustomizeentityforclient_set, 1)); )
+ {
+ WITH(entity, self, e, e.uncustomizeentityforclient());
+ }
}
void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer)
{
}
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity, int) sendfunc)
-{
+{SELFPARAM();
vector mi, ma;
if (e.classname == "")
void adaptor_think2touch()
-{
+{SELFPARAM();
entity o;
o = other;
other = world;
}
void adaptor_think2use()
-{
+{SELFPARAM();
entity o, a;
o = other;
a = activator;
}
void adaptor_think2use_hittype_splash() // for timed projectile detonation
-{
+{SELFPARAM();
if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
self.projectiledeathtype |= HITTYPE_SPLASH;
adaptor_think2use();
// deferred dropping
void DropToFloor_Handler()
-{
+{SELFPARAM();
builtin_droptofloor();
self.dropped_origin = self.origin;
}
void droptofloor()
-{
+{SELFPARAM();
InitializeEntity(self, DropToFloor_Handler, INITPRIO_DROPTOFLOOR);
}
}
float SUB_NoImpactCheck()
-{
+{SELFPARAM();
// zero hitcontents = this is not the real impact, but either the
// mirror-impact of something hitting the projectile instead of the
// projectile hitting the something, or a touchareagrid one. Neither of
void W_Crylink_Dequeue(entity e);
float WarpZone_Projectile_Touch_ImpactFilter_Callback()
-{
+{SELFPARAM();
if(SUB_OwnerCheck())
return true;
if(SUB_NoImpactCheck())
}
vector shotorg_adjust(vector vecs, float y_is_right, float visual)
-{
+{SELFPARAM();
return shotorg_adjust_values(vecs, y_is_right, visual, self.owner.cvar_cl_gunalign);
}
.float scale2;
float modeleffect_SendEntity(entity to, int sf)
-{
+{SELFPARAM();
float f;
WriteByte(MSG_ENTITY, ENT_CLIENT_MODELEFFECT);
float isPushable(entity e)
{
- if(e.iscreature)
- return true;
if(e.pushable)
return true;
+ if(IS_VEHICLE(e))
+ return false;
+ if(e.iscreature)
+ return true;
switch(e.classname)
{
case "body":