X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fmiscfunctions.qc;h=ab3c204a3676222efb07416e274f85bcc13e5038;hb=bea975add6a9a0c1606678151660bd9ee6053bd4;hp=65d38c8aa90ec3bb672e3edab877bf61d5422a4e;hpb=109c5785a22fb4336ac5e91d5f1fa91678582164;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 65d38c8aa..ab3c204a3 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -851,7 +851,7 @@ void remove_safely(entity e) builtin_remove(e); } -void InitializeEntity(entity e, void() func, float order) +void InitializeEntity(entity e, void(entity this) func, float order) { entity prev, cur; @@ -885,7 +885,7 @@ void InitializeEntity(entity e, void() func, float order) } } void InitializeEntitiesRun() -{SELFPARAM(); +{ entity startoflist = initialize_entity_first; initialize_entity_first = NULL; remove = remove_except_protected; @@ -899,7 +899,7 @@ void InitializeEntitiesRun() 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") { @@ -910,7 +910,7 @@ void InitializeEntitiesRun() //dprint("Delayed initialization: ", e.classname, "\n"); if (func) { - WITH(entity, self, e, func()); + WITHSELF(e, func(e)); } else { @@ -969,26 +969,20 @@ void adaptor_think2touch() void adaptor_think2use() {SELFPARAM(); - entity o, a; - o = other; - a = activator; - activator = world; - other = world; - self.use(); - other = o; - activator = a; + if(this.use1) + this.use1(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; }