#include "../common/vehicles/sv_vehicles.qh"
#include "../common/vehicles/vehicle.qh"
#include "../common/items/all.qc"
+#include "../common/state.qh"
+#include "../common/effects/qc/globalsound.qh"
#include "../lib/csqcmodel/sv_model.qh"
#include "../lib/warpzone/anglestransform.qh"
#include "../lib/warpzone/server.qh"
break; // too many replacements
n = n - 1;
- p1 = strstr(msg, "%", p); // NOTE: this destroys msg as it's a tempstring!
- p2 = strstr(msg, "\\", p); // NOTE: this destroys msg as it's a tempstring!
+ p1 = strstrofs(msg, "%", p); // NOTE: this destroys msg as it's a tempstring!
+ p2 = strstrofs(msg, "\\", p); // NOTE: this destroys msg as it's a tempstring!
if (p1 < 0)
p1 = p2;
/**
* @param f -1: cleanup, 0: request, 1: receive
*/
-void GetCvars(int f)
-{SELFPARAM();
+void GetCvars(entity this, int f)
+{
string s = string_null;
if (f > 0)
}
void precache()
-{SELFPARAM();
+{
// gamemode related things
// Precache all player models if desired
builtin_remove(e);
}
-void InitializeEntity(entity e, void() func, float order)
+void InitializeEntity(entity e, void(entity this) func, float order)
{
entity prev, cur;
}
}
void InitializeEntitiesRun()
-{SELFPARAM();
+{
entity startoflist = initialize_entity_first;
initialize_entity_first = NULL;
remove = remove_except_protected;
e.initialize_entity_order = 0;
entity next = e.initialize_entity_next;
e.initialize_entity_next = NULL;
- var void() func = e.initialize_entity;
+ var void(entity this) func = e.initialize_entity;
e.initialize_entity = func_null;
if (e.classname == "initialize_entity")
{
//dprint("Delayed initialization: ", e.classname, "\n");
if (func)
{
- WITH(entity, self, e, func());
+ WITHSELF(e, func(e));
}
else
{
void adaptor_think2use()
{SELFPARAM();
- entity o, a;
- o = other;
- a = activator;
- activator = world;
- other = world;
- self.use();
- other = o;
- activator = a;
+ if(this.use)
+ this.use(this, NULL, NULL);
}
void adaptor_think2use_hittype_splash() // for timed projectile detonation
{SELFPARAM();
- if(!(IS_ONGROUND(self))) // 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();
+ if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+ this.projectiledeathtype |= HITTYPE_SPLASH;
+ WITHSELF(this, adaptor_think2use());
}
// deferred dropping
-void DropToFloor_Handler()
-{SELFPARAM();
+void DropToFloor_Handler(entity this)
+{
builtin_droptofloor();
self.dropped_origin = self.origin;
}
return 0;
}
-float isPushable(entity e)
+.bool pushable;
+bool isPushable(entity e)
{
if(e.pushable)
return true;
{
case "body":
case "droppedweapon":
- case "keepawayball":
- case "nexball_basketball":
- case "nexball_football":
return true;
case "bullet": // antilagged bullets can't hit this either
return false;