Permalink
Browse files

Saves will now save vertical angles and noclip state

  • Loading branch information...
1 parent 02f5990 commit 9ca9605880bca31f6ff3a72d48fc76cb2509e5ae @robotboy655 robotboy655 committed Apr 20, 2016
Showing with 7 additions and 6 deletions.
  1. +7 −6 garrysmod/lua/includes/gmsave/player.lua
@@ -2,20 +2,21 @@
function gmsave.PlayerSave( ent )
local tab = {}
-
+
tab.Origin = ent:GetPos()
- tab.Angle = ent:GetAngles()
+ tab.Angle = ent:GetAimVector():Angle()
+ tab.MoveType = ent:GetMoveType()
- return tab;
+ return tab
end
-
function gmsave.PlayerLoad( ent, tab )
if ( tab == nil ) then return end
-
+
if ( tab.Origin ) then ent:SetPos( tab.Origin ) end
if ( tab.Angle ) then ent:SetEyeAngles( tab.Angle ) end
-
+ if ( tab.MoveType ) then ent:SetMoveType( tab.MoveType ) end
+
end

0 comments on commit 9ca9605

Please sign in to comment.