Navigation Menu

Skip to content

Commit

Permalink
Fixed Trails Tool Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
robotboy655 committed Jan 19, 2014
1 parent 2a2f269 commit 9aebac4
Showing 1 changed file with 10 additions and 7 deletions.
Expand Up @@ -17,7 +17,7 @@ cleanup.Register( "trails" )

local function SetTrails( Player, Entity, Data )

if ( Entity.SToolTrail ) then
if ( IsValid( Entity.SToolTrail ) ) then

Entity.SToolTrail:Remove()
Entity.SToolTrail = nil
Expand Down Expand Up @@ -96,14 +96,17 @@ function TOOL:LeftClick( trace )

end

local Trail = SetTrails( self:GetOwner(), trace.Entity, { Color = Color( r, g, b, a ),
Length = length,
StartSize = startsize,
EndSize = endsize,
Material = Mat } )
local Trail = SetTrails( self:GetOwner(), trace.Entity, {
Color = Color( r, g, b, a ),
Length = length,
StartSize = startsize,
EndSize = endsize,
Material = Mat
} )

undo.Create("Trail")
undo.AddEntity( Trail )
undo.SetPlayer( ply )
undo.SetPlayer( self:GetOwner() )
undo.Finish()

return true
Expand Down

0 comments on commit 9aebac4

Please sign in to comment.