Preserve flags on unfake, mostly so medics don't stop being medics
This commit is contained in:
parent
08bd3ecdf1
commit
cd7b77914b
2 changed files with 8 additions and 1 deletions
|
|
@ -144,6 +144,11 @@ hook.Add("CreateEntityRagdoll", "zcnpci", function(ent, ragdoll)
|
||||||
-- Why is it like this? Fuck if I know, I just know I don't wanna deal with it again.
|
-- Why is it like this? Fuck if I know, I just know I don't wanna deal with it again.
|
||||||
ragdoll.citizentype = ent:GetInternalVariable("citizentype")
|
ragdoll.citizentype = ent:GetInternalVariable("citizentype")
|
||||||
|
|
||||||
|
ragdoll.respawn_data = {
|
||||||
|
flags = ent:GetFlags(),
|
||||||
|
spawn_flags = ent:GetSpawnFlags()
|
||||||
|
}
|
||||||
|
|
||||||
timer.Simple(0, function()
|
timer.Simple(0, function()
|
||||||
if !IsValid(ragdoll) then return end
|
if !IsValid(ragdoll) then return end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,9 @@ function MODULE:PhysicsSimulate(phys, dt)
|
||||||
|
|
||||||
ent:SetSkin(target:GetSkin())
|
ent:SetSkin(target:GetSkin())
|
||||||
|
|
||||||
|
ent:AddFlags(target.respawn_data.flags)
|
||||||
|
ent:AddSpawnFlags(target.respawn_data.spawn_flags)
|
||||||
|
|
||||||
if target.citizentype then
|
if target.citizentype then
|
||||||
ent:SetKeyValue("citizentype", target.citizentype)
|
ent:SetKeyValue("citizentype", target.citizentype)
|
||||||
end
|
end
|
||||||
|
|
@ -496,7 +499,6 @@ function MODULE:PhysicsSimulate(phys, dt)
|
||||||
self.unfaker:SetNWEntity("parent_npc", ent)
|
self.unfaker:SetNWEntity("parent_npc", ent)
|
||||||
self.unfaker:SetNWFloat("fake_start", self.FakeUpStart)
|
self.unfaker:SetNWFloat("fake_start", self.FakeUpStart)
|
||||||
self.unfaker:SetNWFloat("fake_end", self.FakeUpEnd)
|
self.unfaker:SetNWFloat("fake_end", self.FakeUpEnd)
|
||||||
|
|
||||||
|
|
||||||
target:SetRenderMode(RENDERMODE_NONE)
|
target:SetRenderMode(RENDERMODE_NONE)
|
||||||
ent:SetRenderMode(RENDERMODE_NONE)
|
ent:SetRenderMode(RENDERMODE_NONE)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue