From 2eb36c245f5927bd66689acd7fc35cf4cd3b2510 Mon Sep 17 00:00:00 2001 From: in0finite Date: Sun, 5 Apr 2020 16:08:07 +0200 Subject: [PATCH] fix lower shooting rate --- Assets/Scripts/Behaviours/Ped/States/DriveByState.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Behaviours/Ped/States/DriveByState.cs b/Assets/Scripts/Behaviours/Ped/States/DriveByState.cs index f2e93cd9..acfc62ac 100644 --- a/Assets/Scripts/Behaviours/Ped/States/DriveByState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/DriveByState.cs @@ -11,8 +11,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States // - add real aim anims ? // - drive-by exiting state - activated when going from drive-by to sitting state, or when trying to exit vehicle // - weapon's gun flash should depend on last time when fired, not on anim time - maybe don't change it, because we may play real aim anims - // - sometimes fire direction is going up in the sky when aiming opposite of vehicle's direction - this happens with AWA weapons only - + public WeaponAttackParams WeaponAttackParams @@ -30,8 +29,10 @@ namespace SanAndreasUnity.Behaviours.Peds.States BaseVehicleState.PreparePedForVehicle(m_ped, this.CurrentVehicle, this.CurrentVehicleSeat); - // we should not update firing from here, because it can cause stack overflow - this.UpdateAnimsInternal(false); + // only update firing if ped is not currently firing, because otherwise it can cause stack overflow + // by switching states indefinitely + // also, we must update firing here, because otherwise shooting rate will be lower + this.UpdateAnimsInternal(!m_ped.IsFiring); }