mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Entity creator is not set to player spawning the dupe (#408)
* Fixed: Creator is not set correctly when dupe is pasted * Added: Creator update after every `ents.Create`
This commit is contained in:
parent
b83f6fd028
commit
2c12f32a85
@ -805,7 +805,7 @@ end
|
||||
--[[
|
||||
Name: GenericDuplicatorFunction
|
||||
Desc: Override the default duplicator's GenericDuplicatorFunction function
|
||||
Params: <player> Player, <table> data
|
||||
Params: <table> data, <player> Player
|
||||
Returns: <entity> Entity
|
||||
]]
|
||||
local function GenericDuplicatorFunction(data, Player)
|
||||
@ -830,6 +830,7 @@ local function GenericDuplicatorFunction(data, Player)
|
||||
end
|
||||
|
||||
duplicator.DoGeneric(Entity, data)
|
||||
if (Player) then Entity:SetCreator(Player) end
|
||||
Entity:Spawn()
|
||||
Entity:Activate()
|
||||
DoGenericPhysics(Entity, data, Player)
|
||||
@ -870,6 +871,7 @@ local function MakeProp(Player, Pos, Ang, Model, PhysicsObject, Data)
|
||||
if not IsValid(Prop) then return false end
|
||||
|
||||
duplicator.DoGeneric(Prop, Data)
|
||||
if (Player) then Prop:SetCreator(Player) end
|
||||
Prop:Spawn()
|
||||
Prop:Activate()
|
||||
DoGenericPhysics(Prop, Data, Player)
|
||||
|
@ -498,6 +498,7 @@ if(SERVER)then
|
||||
spawner:SetAngles(Ang)
|
||||
spawner:SetModel(model)
|
||||
spawner:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
spawner:SetCreator(ply)
|
||||
spawner:Spawn()
|
||||
|
||||
duplicator.ApplyEntityModifiers(ply, spawner)
|
||||
|
Loading…
Reference in New Issue
Block a user