From: Mario Date: Sun, 27 Mar 2016 11:53:07 +0000 (+1000) Subject: Merge branch 'master' into Mario/use1 X-Git-Tag: xonotic-v0.8.2~945^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f438b415278f56c0cf86e2018b45fb3e6972259c;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/use1 # Conflicts: # qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc # qcsrc/common/triggers/target/spawn.qc # qcsrc/common/triggers/trigger/gamestart.qc # qcsrc/lib/defer.qh # qcsrc/server/mutators/mutator/gamemode_assault.qc --- f438b415278f56c0cf86e2018b45fb3e6972259c diff --cc qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc index 212420753,5271beba1..056d33a03 --- a/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc @@@ -1941,11 -1951,11 +1941,11 @@@ MUTATOR_HOOKFUNCTION(ons, MonsterMove return false; } - void ons_MonsterSpawn_Delayed() - {SELFPARAM(); - entity own = this.owner; + void ons_MonsterSpawn_Delayed(entity this) + { - entity e, own = self.owner; ++ entity own = self.owner; - if(!own) { remove(self); return; } + if(!own) { remove(this); return; } if(own.targetname) { @@@ -1970,9 -1981,9 +1970,9 @@@ MUTATOR_HOOKFUNCTION(ons, MonsterSpawn return false; } - void ons_TurretSpawn_Delayed() - {SELFPARAM(); + void ons_TurretSpawn_Delayed(entity this) + { - entity e, own = self.owner; + entity own = self.owner; if(!own) { remove(self); return; } diff --cc qcsrc/common/triggers/func/door.qc index af7cd8e26,1e19dfafc..0546b2eae --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@@ -842,12 -848,12 +842,12 @@@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew this.trigger_touch = door_touch; this.draw = door_draw; this.drawmask = MASK_NORMAL; - this.use = door_use; + this.use1 = door_use; - LinkDoors(); + LinkDoors(this); if(this.spawnflags & DOOR_START_OPEN) - door_init_startopen(); + door_init_startopen(this); this.move_time = time; this.move_origin = this.origin; diff --cc qcsrc/common/triggers/func/train.qc index 2a5a70211,2b27c7355..0fa3ed601 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@@ -176,15 -176,16 +176,15 @@@ void train_link( //Net_LinkEntity(self, 0, false, train_send); } -void train_use() +void train_use(entity this, entity actor, entity trigger) { - SELFPARAM(); - self.SUB_NEXTTHINK = self.SUB_LTIME + 1; - self.SUB_THINK = train_next; - self.use = func_null; // not again + this.SUB_NEXTTHINK = this.SUB_LTIME + 1; + this.SUB_THINK = train_next; + this.use1 = func_null; // not again } - void func_train_find() - {SELFPARAM(); + void func_train_find(entity this) + { entity targ; targ = find(world, targetname, self.target); self.target = targ.target; diff --cc qcsrc/common/triggers/target/spawn.qc index f02b29625,82793c936..e6114a520 --- a/qcsrc/common/triggers/target/spawn.qc +++ b/qcsrc/common/triggers/target/spawn.qc @@@ -292,11 -297,11 +292,11 @@@ void target_spawn_use(entity this, enti } } - void target_spawn_spawnfirst() - {SELFPARAM(); - entity act = self.target_spawn_activator; - if(self.spawnflags & 2) + void target_spawn_spawnfirst(entity this) + { - activator = self.target_spawn_activator; - if(self.spawnflags & 2) - target_spawn_use(); ++ entity act = this.target_spawn_activator; ++ if(this.spawnflags & 2) + target_spawn_use(this, act, NULL); } void initialize_field_db() diff --cc qcsrc/lib/self.qh index 5d53694c7,31d7d07c8..092a8945b --- a/qcsrc/lib/self.qh +++ b/qcsrc/lib/self.qh @@@ -32,3 -32,15 +32,15 @@@ #endif // Step 6: Remove SELFPARAM in favor of a parameter + + .void(entity this) selftouch; + void touch_self() { SELFPARAM(); this.selftouch(this); } + #define settouch(e, f) (e.touch = touch_self, e.selftouch = f) + -.void(entity this) selfuse; -void use_self() { SELFPARAM(); this.selfuse(this); } -#define setuse(e, f) (e.use = use_self, e.selfuse = f) ++//.void(entity this) selfuse; ++//void use_self() { SELFPARAM(); this.selfuse(this); } ++//#define setuse(e, f) (e.use = use_self, e.selfuse = f) + + .void(entity this) selfthink; + void think_self() { SELFPARAM(); this.selfthink(this); } + #define setthink(e, f) (e.think = think_self, e.selfthink = f) diff --cc qcsrc/server/g_models.qc index 4f75e7beb,baca56178..003b2efa9 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@@ -16,43 -16,43 +16,43 @@@ class(BGMScript) .float bgmscriptreleas .float modelscale; -void g_model_setcolormaptoactivator () -{SELFPARAM(); +void g_model_setcolormaptoactivator(entity this, entity actor, entity trigger) +{ if(teamplay) { - if(activator.team) - self.colormap = (activator.team - 1) * 0x11; + if(actor.team) + this.colormap = (actor.team - 1) * 0x11; else - self.colormap = 0x00; + this.colormap = 0x00; } else - self.colormap = floor(random() * 256); - self.colormap |= BIT(10); // RENDER_COLORMAPPED + this.colormap = floor(random() * 256); + this.colormap |= BIT(10); // RENDER_COLORMAPPED } -void g_clientmodel_setcolormaptoactivator () -{SELFPARAM(); - g_model_setcolormaptoactivator(); - self.SendFlags |= (BIT(3) | BIT(0)); +void g_clientmodel_setcolormaptoactivator(entity this, entity actor, entity trigger) +{ + g_model_setcolormaptoactivator(this, actor, trigger); + this.SendFlags |= (BIT(3) | BIT(0)); } -void g_clientmodel_use() -{SELFPARAM(); - if (self.antiwall_flag == 1) +void g_clientmodel_use(entity this, entity actor, entity trigger) +{ + if (this.antiwall_flag == 1) { - self.inactive = 1; - self.solid = SOLID_NOT; + this.inactive = 1; + this.solid = SOLID_NOT; } - else if (self.antiwall_flag == 2) + else if (this.antiwall_flag == 2) { - self.inactive = 0; - self.solid = self.default_solid; + this.inactive = 0; + this.solid = this.default_solid; } - g_clientmodel_setcolormaptoactivator(); + g_clientmodel_setcolormaptoactivator(this, actor, trigger); } - void g_model_dropbyspawnflags() - {SELFPARAM(); + void g_model_dropbyspawnflags(entity this) + { if((self.spawnflags & 3) == 1) // ALIGN_ORIGIN { traceline(self.origin, self.origin - '0 0 4096', MOVE_NOMONSTERS, self); diff --cc qcsrc/server/mutators/mutator/gamemode_assault.qc index c2d5ed3b9,34c19d425..e358f8fba --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@@ -232,6 -242,11 +232,11 @@@ void assault_roundstart_use(entity this WITHSELF(it, turret_respawn()); )); } + void assault_roundstart_use_self() + { + SELFPARAM(); - assault_roundstart_use(this); ++ assault_roundstart_use(this, NULL, NULL); + } void assault_wall_think() {SELFPARAM(); @@@ -422,9 -437,9 +427,9 @@@ spawnfunc(target_assault_roundstart assault_attacker_team = NUM_TEAM_1; self.classname = "target_assault_roundstart"; - self.use1 = assault_roundstart_use; - self.reset2 = adaptor_think2use; - InitializeEntity(self, adaptor_think2use, INITPRIO_FINDTARGET); - self.use = assault_roundstart_use_self; ++ self.use = assault_roundstart_use; + self.reset2 = assault_roundstart_use_self; - InitializeEntity(self, assault_roundstart_use, INITPRIO_FINDTARGET); ++ InitializeEntity(self, assault_roundstart_use_self, INITPRIO_FINDTARGET); } // legacy bot code