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

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

View File

@@ -1,5 +1,5 @@
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Special box"
ENT.Author = ""
ENT.Contact = ""