From 2275aceea6d8f3db04b1b9de2d9556cb7554d373 Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Fri, 22 Jul 2022 22:13:02 +0100 Subject: [FD] More Mortar Spectre fixes (#449) * Some more IsValid checks for mortar spectres * check to make sure spectre actually has a weapon --- .../mod/scripts/vscripts/ai/_ai_mortar_spectres.gnut | 15 ++++++++------- 1 file 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 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 } } -- cgit v1.2.3