Skip to content

Commit

Permalink
修正:Demo里可能的一些lua报错
Browse files Browse the repository at this point in the history
  • Loading branch information
forsakenyang committed May 11, 2022
1 parent 7411fea commit 7f95398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Content/Script/BP_CharacterBase_C.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions Content/Script/Player/BP_PlayerController_C.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7f95398

Please sign in to comment.