diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2022-07-22 22:13:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 23:13:02 +0200 |
commit | 2275aceea6d8f3db04b1b9de2d9556cb7554d373 (patch) | |
tree | ccc321556968900c5f8ce044cb090de9197a0834 /Northstar.CustomServers/mod/scripts/vscripts/ai | |
parent | 96f061ea081971e11ad6746940ba2dadbc395a25 (diff) | |
download | NorthstarMods-2275aceea6d8f3db04b1b9de2d9556cb7554d373.tar.gz NorthstarMods-2275aceea6d8f3db04b1b9de2d9556cb7554d373.zip |
[FD] More Mortar Spectre fixes (#449)
* Some more IsValid checks for mortar spectres
* check to make sure spectre actually has a weapon
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/ai')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut index df391a88..a136c2c9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut @@ -110,13 +110,12 @@ void function MortarSpectreAttack( entity spectre, entity harvester, entity sign while( true ) { - entity weapon = spectre.GetActiveWeapon() - - while ( weapon.IsWeaponOffhand() ) - { - WaitFrame() - weapon = spectre.GetActiveWeapon() - } + array<entity> weapons = spectre.GetMainWeapons() + if ( weapons.len() == 0 ) + break + entity weapon = weapons[0] + if ( !IsValid( weapon ) ) + break originalWeaponClassName = weapon.GetWeaponClassName() originalWeaponMods = weapon.GetMods() @@ -131,6 +130,8 @@ void function MortarSpectreAttack( entity spectre, entity harvester, entity sign wait MORTAR_SPECTRE_REENGAGE_DELAY + if ( !IsValid( spectre ) ) + break } } |