[FIXED] attempt to call method 'GetPlayerName' (a nil value)

This commit is contained in:
Shafik 2025-01-05 10:47:14 +02:00
parent f9747d1c4c
commit 8523b7e20a

View File

@ -411,7 +411,7 @@ function CLEANUP_AIRBASE.__:CleanUpSchedule()
end
end
-- Clean Units which are waiting for a very long time in the CleanUpZone.
if CleanUpUnit and not CleanUpUnit:GetPlayerName() then
if CleanUpUnit and (CleanUpUnit.GetPlayerName == nil or not CleanUpUnit:GetPlayerName()) then
local CleanUpUnitVelocity = CleanUpUnit:GetVelocityKMH()
if CleanUpUnitVelocity < 1 then
if CleanUpListData.CleanUpMoved then