From 7d046a063804d5a0507d559c67c6cdf2447b386d Mon Sep 17 00:00:00 2001 From: kosmik641 Date: Wed, 12 Nov 2025 16:14:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20self:GetOwner()=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=81=D0=BB=D0=B5=D0=B4=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20"base=5Fg?= =?UTF-8?q?modentity"=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE=D1=80=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D0=B9=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D1=8B=20E2=20(enitiy():owner())=20=D0=97=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=20self:GetOwner()=20=D0=BD=D0=B0=20sel?= =?UTF-8?q?f:GetPlayer()/SetPlayer()=20=D1=82=D0=B0=D0=BC,=20=D0=B3=D0=B4?= =?UTF-8?q?=D0=B5=20=D1=8D=D1=82=D0=BE=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D0=BC=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_base/init.lua | 14 +++++++------- lua/entities/gmod_subway_base/shared.lua | 2 +- lua/entities/gmod_train_autodrive_coil/shared.lua | 2 +- lua/entities/gmod_train_bogey/init.lua | 8 ++++---- lua/entities/gmod_train_bogey/shared.lua | 2 +- lua/entities/gmod_train_couple/shared.lua | 2 +- lua/entities/gmod_train_special_box/init.lua | 3 +-- lua/entities/gmod_train_special_box/shared.lua | 2 +- lua/entities/gmod_train_wheels/shared.lua | 2 +- lua/metrostroi/sv_debugger.lua | 2 +- lua/ulx/modules/sh/metrostroi.lua | 4 ++-- 11 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lua/entities/gmod_subway_base/init.lua b/lua/entities/gmod_subway_base/init.lua index 3832bc7..4c0e30f 100644 --- a/lua/entities/gmod_subway_base/init.lua +++ b/lua/entities/gmod_subway_base/init.lua @@ -57,7 +57,7 @@ function ENT:PostEntityPaste(ply,ent,createdEntities) v[1].NoPhysics = v[2] or nil -- Assign ownership - if IsValid(self:GetOwner()) then v[1]:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then v[1]:SetPlayer(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then v[1]:CPPISetOwner(self:CPPIGetOwner()) end -- Some shared general information about the bogey @@ -107,7 +107,7 @@ function ENT:Initialize() self:SetUseType(SIMPLE_USE) -- Prop-protection related if IsValid(self.Owner) then - self:SetOwner(self.Owner) + self:SetPlayer(self.Owner) if CPPI then self:CPPISetOwner(self.Owner) end end -- Entities that belong to train and must be cleaned up later @@ -1034,7 +1034,7 @@ function ENT:CreateBogey(pos,ang,forward,typ) bogey:Spawn() -- Assign ownership - if IsValid(self:GetOwner()) then bogey:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then bogey:SetPlayer(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then bogey:CPPISetOwner(self:CPPIGetOwner()) end -- Some shared general information about the bogey @@ -1072,7 +1072,7 @@ function ENT:CreateBogey(pos,ang,forward,typ) end function ENT:AddLightSensor(pos,ang,model) local sensor = ents.Create("gmod_train_autodrive_coil") - if IsValid(self:GetOwner()) then sensor:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then sensor:SetPlayer(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then sensor:CPPISetOwner(self:CPPIGetOwner()) end sensor:SetPos(self:LocalToWorld(pos)) sensor:SetAngles(self:LocalToWorldAngles(ang)) @@ -1095,7 +1095,7 @@ function ENT:AddAutodriveCoil(bogey,right) bogey.CoilL = coil end -- Assign ownership - if IsValid(self:GetOwner()) then coil:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then coil:SetPlayer(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then coil:CPPISetOwner(self:CPPIGetOwner()) end end if right then @@ -1121,7 +1121,7 @@ function ENT:CreateCouple(pos,ang,forward,typ) coupler:Spawn() -- Assign ownership - if IsValid(self:GetOwner()) then coupler:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then coupler:SetPlayer(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then coupler:CPPISetOwner(self:CPPIGetOwner()) end -- Some shared general information about the bogey @@ -1194,7 +1194,7 @@ function ENT:CreateSeatEntity(seat_info) self:DrawShadow(false) --Assign ownership - if IsValid(self:GetOwner()) then seat:SetOwner(self:GetOwner()) end + if IsValid(self:GetPlayer()) then seat:SetOwner(self:GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then seat:CPPISetOwner(self:CPPIGetOwner()) end -- Hide the entity visually diff --git a/lua/entities/gmod_subway_base/shared.lua b/lua/entities/gmod_subway_base/shared.lua index 4888aff..ec75078 100644 --- a/lua/entities/gmod_subway_base/shared.lua +++ b/lua/entities/gmod_subway_base/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.Author = "" ENT.Contact = "" ENT.Purpose = "" diff --git a/lua/entities/gmod_train_autodrive_coil/shared.lua b/lua/entities/gmod_train_autodrive_coil/shared.lua index 05d824d..1b97275 100644 --- a/lua/entities/gmod_train_autodrive_coil/shared.lua +++ b/lua/entities/gmod_train_autodrive_coil/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.PrintName = "Autodrive coil" ENT.Category = "Metrostroi (utility)" diff --git a/lua/entities/gmod_train_bogey/init.lua b/lua/entities/gmod_train_bogey/init.lua index 893c7b9..ad62130 100644 --- a/lua/entities/gmod_train_bogey/init.lua +++ b/lua/entities/gmod_train_bogey/init.lua @@ -151,10 +151,10 @@ function ENT:InitializeWheels() end -- Assign ownership - if IsValid(self:GetOwner()) then - wheels:SetOwner(self:GetOwner()) - elseif IsValid(self:GetNW2Entity("TrainEntity"):GetOwner()) then - wheels:SetOwner(self:GetNW2Entity("TrainEntity"):GetOwner()) + if IsValid(self:GetPlayer()) then + wheels:SetPlayer(self:GetPlayer()) + elseif IsValid(self:GetNW2Entity("TrainEntity"):GetPlayer()) then + wheels:SetPlayer(self:GetNW2Entity("TrainEntity"):GetPlayer()) end if CPPI and IsValid(self:CPPIGetOwner()) then diff --git a/lua/entities/gmod_train_bogey/shared.lua b/lua/entities/gmod_train_bogey/shared.lua index 02d315e..df169ba 100644 --- a/lua/entities/gmod_train_bogey/shared.lua +++ b/lua/entities/gmod_train_bogey/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.Author = "" ENT.Contact = "" ENT.Purpose = "" diff --git a/lua/entities/gmod_train_couple/shared.lua b/lua/entities/gmod_train_couple/shared.lua index 81700a9..2e23df6 100644 --- a/lua/entities/gmod_train_couple/shared.lua +++ b/lua/entities/gmod_train_couple/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.Author = "" ENT.Contact = "" ENT.Purpose = "" diff --git a/lua/entities/gmod_train_special_box/init.lua b/lua/entities/gmod_train_special_box/init.lua index 7b8a3d2..c7ee48a 100644 --- a/lua/entities/gmod_train_special_box/init.lua +++ b/lua/entities/gmod_train_special_box/init.lua @@ -34,11 +34,10 @@ function ENT:Use(_,ply) self.Cover:SetPos(self:LocalToWorld(Vector(0,0,5.7))) self.Cover:SetAngles(self:GetAngles()) self.Cover:Spawn() - self.Cover:SetOwner(self.Owner) local phys = self.Cover:GetPhysicsObject() phys:ApplyForceCenter(self.Cover:GetUp()*phys:GetMass()*40+self.Cover:GetRight()*phys:GetMass()*35 ) if IsValid(self.Owner) then - self.Cover:SetOwner(self.Owner) + self.Cover:SetPlayer(self.Owner) if CPPI then self.Cover:CPPISetOwner(self.Owner) end end if self.Code then self:SetNW2Int("Code",self.Code) end diff --git a/lua/entities/gmod_train_special_box/shared.lua b/lua/entities/gmod_train_special_box/shared.lua index 8bf6731..52732df 100644 --- a/lua/entities/gmod_train_special_box/shared.lua +++ b/lua/entities/gmod_train_special_box/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.PrintName = "Special box" ENT.Author = "" ENT.Contact = "" diff --git a/lua/entities/gmod_train_wheels/shared.lua b/lua/entities/gmod_train_wheels/shared.lua index 817ff03..8138b9e 100644 --- a/lua/entities/gmod_train_wheels/shared.lua +++ b/lua/entities/gmod_train_wheels/shared.lua @@ -1,5 +1,5 @@ ENT.Type = "anim" - +ENT.Base = "base_gmodentity" ENT.PrintName = "Train Wheels" ENT.Author = "" ENT.Contact = "" diff --git a/lua/metrostroi/sv_debugger.lua b/lua/metrostroi/sv_debugger.lua index 9d20864..ea43957 100644 --- a/lua/metrostroi/sv_debugger.lua +++ b/lua/metrostroi/sv_debugger.lua @@ -60,7 +60,7 @@ concommand.Add("metrostroi_debugtrainsystems", cmdinithandler, nil, "Add aimed a -- Automatically engage debugger for train owner function Metrostroi.DebugTrain(train,ply) - if not ply then ply = train:GetOwner() end + if not ply then ply = train:GetPlayer() end if (not IsValid(train)) or (not IsValid(ply)) then return end AddClient(ply,train) diff --git a/lua/ulx/modules/sh/metrostroi.lua b/lua/ulx/modules/sh/metrostroi.lua index 3e6da25..c1bc436 100644 --- a/lua/ulx/modules/sh/metrostroi.lua +++ b/lua/ulx/modules/sh/metrostroi.lua @@ -108,7 +108,7 @@ function ulx.trains( calling_ply, ToP ) for k2,ent in pairs(ents) do if ent.NoTrain or trains[ent] or (ent.FrontTrain and ent.RearTrain) or not ent.WagonList then continue end - local owner = CPPI and ent:CPPIGetOwner() or ent:GetOwner() + local owner = CPPI and ent:CPPIGetOwner() or ent:GetPlayer() local canShow = not ToP or ToP == "" or IsValid(owner) and owner:GetName():find(ToP) if not canShow and not tonumber(ToP) then continue end @@ -181,7 +181,7 @@ function ulx.traingoto( calling_ply, ToP) for k2,ent in pairs(ents) do if ent.NoTrain then continue end - local owner = CPPI and ent:CPPIGetOwner() or ent:GetOwner() + local owner = CPPI and ent:CPPIGetOwner() or ent:GetPlayer() local driver = ent:GetDriver() if not ToS and owner == calling_ply and not (ent.FrontTrain and ent.RearTrain) then train = ent break end if ToS and driver and driver:GetName():find(ToS) and not ulx.getExclusive(driver,calling_ply) then train = ent break end