mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 15:17:57 -05:00
Tranzit: optimize bus wallbuy code
This commit is contained in:
@ -12,6 +12,12 @@ wallbuy_player_connect(localclientnum)
|
||||
for (i = 0; i < keys.size; i++)
|
||||
{
|
||||
wallbuy = level._active_wallbuys[keys[i]];
|
||||
|
||||
if (isdefined(wallbuy.script_string) && wallbuy.script_string == "bus_buyable_weapon1")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
fx = level._effect["m14_zm_fx"];
|
||||
|
||||
if (wallbuy.targetname == "buildable_wallbuy")
|
||||
|
@ -6,13 +6,6 @@
|
||||
init_weapon_upgrade()
|
||||
{
|
||||
init_spawnable_weapon_upgrade();
|
||||
weapon_spawns = [];
|
||||
weapon_spawns = getentarray("weapon_upgrade", "targetname");
|
||||
|
||||
for (i = 0; i < weapon_spawns.size; i++)
|
||||
{
|
||||
scripts\zm\replaced\utility::wallbuy(weapon_spawns[i].zombie_weapon_upgrade, weapon_spawns[i].target + "_weapon_upgrade", weapon_spawns[i].targetname, weapon_spawns[i].origin, weapon_spawns[i].angles, 0);
|
||||
}
|
||||
}
|
||||
|
||||
init_spawnable_weapon_upgrade()
|
||||
|
@ -532,24 +532,18 @@ buspathblockersetup()
|
||||
if (isdefined(cow_catcher_blocker))
|
||||
cow_catcher_blocker linkto(self, "", self worldtolocalcoords(cow_catcher_blocker.origin), cow_catcher_blocker.angles + self.angles);
|
||||
|
||||
trig = getent("bus_buyable_weapon1", "script_noteworthy");
|
||||
trig enablelinkto();
|
||||
trig linkto(self, "", self worldtolocalcoords(trig.origin), (0, 0, 0));
|
||||
trig setinvisibletoall();
|
||||
self.buyable_weapon = trig;
|
||||
level._spawned_wallbuys[level._spawned_wallbuys.size] = trig;
|
||||
weapon_model = getent(trig.target, "targetname");
|
||||
weapon_model.origin += (0, 0, 1);
|
||||
weapon_model linkto(self, "", self worldtolocalcoords(weapon_model.origin), weapon_model.angles + self.angles);
|
||||
weapon_model setmovingplatformenabled(1);
|
||||
weapon_model._linked_ent = trig;
|
||||
weapon_model hide();
|
||||
|
||||
self thread bus_buyable_weapon_unitrigger_setup(trig);
|
||||
self thread bus_buyable_weapon_unitrigger_setup();
|
||||
}
|
||||
|
||||
bus_buyable_weapon_unitrigger_setup(trig)
|
||||
bus_buyable_weapon_unitrigger_setup()
|
||||
{
|
||||
weapon_model = getent("bus_buyable_weapon1", "script_noteworthy");
|
||||
weapon_model enablelinkto();
|
||||
weapon_model linkto(self, "", self worldtolocalcoords(weapon_model.origin), weapon_model.angles + self.angles);
|
||||
weapon_model setmovingplatformenabled(1);
|
||||
weapon_model._linked_ent = self;
|
||||
weapon_model hide();
|
||||
|
||||
unitrigger = undefined;
|
||||
|
||||
while (!isDefined(unitrigger))
|
||||
@ -566,11 +560,24 @@ bus_buyable_weapon_unitrigger_setup(trig)
|
||||
wait 1;
|
||||
}
|
||||
|
||||
unitrigger.target = trig.target;
|
||||
unitrigger.origin_parent = trig;
|
||||
unitrigger.link_parent = trig;
|
||||
unitrigger.require_look_at = 0;
|
||||
unitrigger.target = weapon_model;
|
||||
unitrigger.origin_parent = weapon_model;
|
||||
unitrigger.link_parent = self;
|
||||
unitrigger.originfunc = ::bus_buyable_weapon_get_unitrigger_origin;
|
||||
unitrigger.onspawnfunc = ::bus_buyable_weapon_on_spawn_trigger;
|
||||
|
||||
while (1)
|
||||
{
|
||||
level waittill("weapon_bought", player, weapon);
|
||||
|
||||
if (weapon == "beretta93r_zm")
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
weapon_model show();
|
||||
}
|
||||
|
||||
bus_buyable_weapon_get_unitrigger_origin()
|
||||
|
Reference in New Issue
Block a user