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.
|
||||
ragdoll.citizentype = ent:GetInternalVariable("citizentype")
|
||||
|
||||
ragdoll.respawn_data = {
|
||||
flags = ent:GetFlags(),
|
||||
spawn_flags = ent:GetSpawnFlags()
|
||||
}
|
||||
|
||||
timer.Simple(0, function()
|
||||
if !IsValid(ragdoll) then return end
|
||||
|
||||
|
|
|
|||
|
|
@ -439,6 +439,9 @@ function MODULE:PhysicsSimulate(phys, dt)
|
|||
|
||||
ent:SetSkin(target:GetSkin())
|
||||
|
||||
ent:AddFlags(target.respawn_data.flags)
|
||||
ent:AddSpawnFlags(target.respawn_data.spawn_flags)
|
||||
|
||||
if target.citizentype then
|
||||
ent:SetKeyValue("citizentype", target.citizentype)
|
||||
end
|
||||
|
|
@ -497,7 +500,6 @@ function MODULE:PhysicsSimulate(phys, dt)
|
|||
self.unfaker:SetNWFloat("fake_start", self.FakeUpStart)
|
||||
self.unfaker:SetNWFloat("fake_end", self.FakeUpEnd)
|
||||
|
||||
|
||||
target:SetRenderMode(RENDERMODE_NONE)
|
||||
ent:SetRenderMode(RENDERMODE_NONE)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue