X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Ftarget_spawn.qc;h=ebb89aa5c9c0bf274742139a99d56f3ecf2eacb2;hb=e14bb786305e05541496fb5b28c090e0ff1b5783;hp=e04e2cad88f5cb33bd2639ff3f56df2593ccbdbf;hpb=1c2bdc1f0012349f80906e05902ce19bed35be16;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/target_spawn.qc b/qcsrc/server/target_spawn.qc index e04e2cad8..ebb89aa5c 100644 --- a/qcsrc/server/target_spawn.qc +++ b/qcsrc/server/target_spawn.qc @@ -22,7 +22,7 @@ void target_spawn_helper_setsize() setsize(self, self.mins, self.maxs); } -void target_spawn_useon(entity e) +void target_spawn_edit_entity(entity e, string msg, entity kt, entity t2, entity t3, entity t4, entity act) { float i, n, valuefieldpos; string key, value, valuefield, valueoffset, valueoffsetrandom; @@ -30,15 +30,8 @@ void target_spawn_useon(entity e) vector data, data2; entity oldself; entity oldactivator; - entity kt, t2, t3, t4; - - n = tokenize_console(self.message); - self.target_spawn_activator = activator; - kt = find(world, targetname, self.killtarget); - t2 = find(world, targetname, self.target2); - t3 = find(world, targetname, self.target3); - t4 = find(world, targetname, self.target4); + n = tokenize_console(msg); for(i = 0; i < n-1; i += 2) { @@ -101,7 +94,7 @@ void target_spawn_useon(entity e) } else if(value == "activator") { - valueent = activator; + valueent = act; value = ""; } else if(value == "other") @@ -111,8 +104,8 @@ void target_spawn_useon(entity e) } else if(value == "pusher") { - if(time < activator.pushltime) - valueent = activator.pusher; + if(time < act.pushltime) + valueent = act.pusher; else valueent = world; value = ""; @@ -221,7 +214,7 @@ void target_spawn_useon(entity e) oldactivator = activator; self = e; - activator = oldself.target_spawn_activator; + activator = act; self.target_spawn_spawnfunc(); @@ -237,6 +230,20 @@ void target_spawn_useon(entity e) } } +void target_spawn_useon(entity e) +{ + self.target_spawn_activator = activator; + target_spawn_edit_entity( + e, + self.message, + find(world, targetname, self.killtarget), + find(world, targetname, self.target2), + find(world, targetname, self.target3), + find(world, targetname, self.target4), + activator + ); +} + float target_spawn_cancreate() { float c;