1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-10 15:17:57 -05:00

Maxis Drone: fix not switching back to previous weapon

This commit is contained in:
Jbleezy
2022-01-03 04:07:13 -08:00
parent 834e0d46f0
commit 2e4e1e9e61
3 changed files with 61 additions and 0 deletions

View File

@ -195,6 +195,9 @@
### Subsurface Resonator
* No longer needs to be powered by a Turbine
### Maxis Drone
* Switches back to correct weapon after deploying
## Bank
* Disabled

View File

@ -0,0 +1,51 @@
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\zombies\_zm_utility;
quadrotor_control_thread()
{
self endon( "bled_out" );
self endon( "disconnect" );
while ( 1 )
{
if ( self actionslottwobuttonpressed() && self hasweapon( "equip_dieseldrone_zm" ) )
{
prev_wep = self getCurrentWeapon();
self waittill( "weapon_change_complete" );
self playsound( "veh_qrdrone_takeoff" );
if(self hasweapon(prev_wep) && prev_wep != "equip_dieseldrone_zm")
{
self switchtoweapon( prev_wep );
}
else
{
self switchtoweapon( self getweaponslistprimaries()[0] );
}
self waittill( "weapon_change_complete" );
if ( self hasweapon( "equip_dieseldrone_zm" ) )
{
self takeweapon( "equip_dieseldrone_zm" );
self setactionslot( 2, "" );
}
str_vehicle = "heli_quadrotor_zm";
if ( flag( "ee_maxis_drone_retrieved" ) )
{
str_vehicle = "heli_quadrotor_upgraded_zm";
}
qr = spawnvehicle( "veh_t6_dlc_zm_quadrotor", "quadrotor_ai", str_vehicle, self.origin + vectorScale( ( 0, 0, 1 ), 96 ), self.angles );
level thread maps/mp/zm_tomb_craftables::quadrotor_death_watcher( qr );
qr thread maps/mp/zm_tomb_craftables::quadrotor_instance_watcher( self );
return;
}
wait 0.05;
}
}

View File

@ -2,6 +2,13 @@
#include common_scripts\utility;
#include maps\mp\zombies\_zm_utility;
#include scripts/zm/replaced/zm_tomb_craftables;
main()
{
replaceFunc(maps/mp/zm_tomb_craftables::quadrotor_control_thread, scripts/zm/replaced/zm_tomb_craftables::quadrotor_control_thread);
}
init()
{
level.custom_magic_box_timer_til_despawn = ::custom_magic_box_timer_til_despawn;