1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Фикс self:GetOwner()

Добавлено наследование от базового класса "base_gmodentity" для корректной работы E2 (enitiy():owner())
Заменен self:GetOwner() на self:GetPlayer()/SetPlayer() там, где это необходимо
This commit is contained in:
kosmik641
2025-11-12 16:14:02 +03:00
parent 499770d9d3
commit 7d046a0638
11 changed files with 21 additions and 22 deletions

View File

@@ -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