mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
Дополнительные проверки для Get/SetPlayer()
This commit is contained in:
@@ -151,16 +151,17 @@ function ENT:InitializeWheels()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Assign ownership
|
-- Assign ownership
|
||||||
|
local train = self:GetNW2Entity("TrainEntity")
|
||||||
if IsValid(self:GetPlayer()) then
|
if IsValid(self:GetPlayer()) then
|
||||||
wheels:SetPlayer(self:GetPlayer())
|
wheels:SetPlayer(self:GetPlayer())
|
||||||
elseif IsValid(self:GetNW2Entity("TrainEntity"):GetPlayer()) then
|
elseif IsValid(train) and IsValid(train:GetPlayer()) then
|
||||||
wheels:SetPlayer(self:GetNW2Entity("TrainEntity"):GetPlayer())
|
wheels:SetPlayer(train:GetPlayer())
|
||||||
end
|
end
|
||||||
|
|
||||||
if CPPI and IsValid(self:CPPIGetOwner()) then
|
if CPPI and IsValid(self:CPPIGetOwner()) then
|
||||||
wheels:CPPISetOwner(self:CPPIGetOwner())
|
wheels:CPPISetOwner(self:CPPIGetOwner())
|
||||||
elseif CPPI and IsValid(self:GetNW2Entity("TrainEntity"):CPPIGetOwner()) then
|
elseif CPPI and IsValid(train) and IsValid(train:CPPIGetOwner()) then
|
||||||
wheels:CPPISetOwner(self:GetNW2Entity("TrainEntity"):CPPIGetOwner())
|
wheels:CPPISetOwner(train:CPPIGetOwner())
|
||||||
end
|
end
|
||||||
|
|
||||||
wheels:SetNW2Entity("TrainBogey",self)
|
wheels:SetNW2Entity("TrainBogey",self)
|
||||||
|
|||||||
Reference in New Issue
Block a user