From 7f95398806c6d01d0a3de84deb0504838bfeb8c1 Mon Sep 17 00:00:00 2001 From: forsakenyang Date: Wed, 11 May 2022 14:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9ADemo=E9=87=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E7=9A=84=E4=B8=80=E4=BA=9Blua=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content/Script/BP_CharacterBase_C.lua | 4 ++++ Content/Script/Player/BP_PlayerController_C.lua | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Content/Script/BP_CharacterBase_C.lua b/Content/Script/BP_CharacterBase_C.lua index c29b6639..ac027692 100644 --- a/Content/Script/BP_CharacterBase_C.lua +++ b/Content/Script/BP_CharacterBase_C.lua @@ -70,6 +70,10 @@ end function BP_CharacterBase_C:Destroy(Duration) UE.UKismetSystemLibrary.Delay(self, Duration) + if not self:IsValid() then + return false + end + if self.Weapon then self.Weapon:K2_DestroyActor() end diff --git a/Content/Script/Player/BP_PlayerController_C.lua b/Content/Script/Player/BP_PlayerController_C.lua index 1bf783ee..f9297aad 100644 --- a/Content/Script/Player/BP_PlayerController_C.lua +++ b/Content/Script/Player/BP_PlayerController_C.lua @@ -75,11 +75,15 @@ function BP_PlayerController_C:Fire_Released() end function BP_PlayerController_C:Aim_Pressed() - BPI_Interfaces.UpdateAiming(self.Pawn, true) + if self.Pawn then + BPI_Interfaces.UpdateAiming(self.Pawn, true) + end end function BP_PlayerController_C:Aim_Released() - BPI_Interfaces.UpdateAiming(self.Pawn, false) + if self.Pawn then + BPI_Interfaces.UpdateAiming(self.Pawn, false) + end end return BP_PlayerController_C