1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-24 06:00:36 -05:00

Who's Who: fix no free actor entities error

This commit is contained in:
Jbleezy
2023-04-24 13:56:39 -07:00
parent 5f314bc417
commit a302ad371d
3 changed files with 62 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include scripts\zm\replaced\_zm_pers_upgrades_system;
#include scripts\zm\replaced\_zm_traps;
#include scripts\zm\replaced\_zm_equipment;
#include scripts\zm\replaced\_zm_clone;
#include scripts\zm\replaced\_zm_spawner;
#include scripts\zm\replaced\_zm_ai_basic;
#include scripts\zm\replaced\_zm_melee_weapon;
@ -104,6 +105,7 @@ main()
replaceFunc(maps\mp\zombies\_zm_traps::player_elec_damage, scripts\zm\replaced\_zm_traps::player_elec_damage);
replaceFunc(maps\mp\zombies\_zm_equipment::show_equipment_hint, scripts\zm\replaced\_zm_equipment::show_equipment_hint);
replaceFunc(maps\mp\zombies\_zm_equipment::placed_equipment_think, scripts\zm\replaced\_zm_equipment::placed_equipment_think);
replaceFunc(maps\mp\zombies\_zm_clone::spawn_player_clone, scripts\zm\replaced\_zm_clone::spawn_player_clone);
replaceFunc(maps\mp\zombies\_zm_spawner::zombie_gib_on_damage, scripts\zm\replaced\_zm_spawner::zombie_gib_on_damage);
replaceFunc(maps\mp\zombies\_zm_spawner::head_should_gib, scripts\zm\replaced\_zm_spawner::head_should_gib);
replaceFunc(maps\mp\zombies\_zm_spawner::zombie_can_drop_powerups, scripts\zm\replaced\_zm_spawner::zombie_can_drop_powerups);

View File

@ -0,0 +1,59 @@
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\zombies\_zm_clone;
spawn_player_clone( player, origin = player.origin, forceweapon, forcemodel )
{
primaryweapons = player getweaponslistprimaries();
if ( isdefined( forceweapon ) )
weapon = forceweapon;
else if ( primaryweapons.size )
weapon = primaryweapons[0];
else
weapon = player getcurrentweapon();
weaponmodel = getweaponmodel( weapon );
spawner = getent( "fake_player_spawner", "targetname" );
if ( isdefined( spawner ) )
{
while ( getfreeactorcount() < 1 )
{
wait 0.05;
}
clone = spawner spawnactor();
clone.origin = origin;
clone.isactor = 1;
}
else
{
clone = spawn( "script_model", origin );
clone.isactor = 0;
}
if ( isdefined( forcemodel ) )
clone setmodel( forcemodel );
else
{
clone setmodel( self.model );
if ( isdefined( player.headmodel ) )
{
clone.headmodel = player.headmodel;
clone attach( clone.headmodel, "", 1 );
}
}
if ( weaponmodel != "" && weaponmodel != "none" )
clone attach( weaponmodel, "tag_weapon_right" );
clone.team = player.team;
clone.is_inert = 1;
clone.zombie_move_speed = "walk";
clone.script_noteworthy = "corpse_clone";
clone.actor_damage_func = ::clone_damage_func;
return clone;
}