File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,18 @@ function TOOL:RightClick( trace )
3434 return false
3535 end
3636 else
37- if (self .Target == ent or ent :IsWorld ()) then
38- self :GetOwner ():ChatPrint (" Holoemitter unlinked." )
39- self .Target :UnLink ()
40- self :SetStage (0 )
41- return true
42- end
43- self .Target :Link ( ent )
4437 self :SetStage (0 )
45- self :GetOwner ():ChatPrint ( " Holoemitter linked to entity (" .. tostring (ent ).. " )" )
38+
39+ if IsValid (self .Target ) then
40+ if self .Target == ent or ent :IsWorld () then
41+ self :GetOwner ():ChatPrint (" Holoemitter unlinked." )
42+ self .Target :UnLink ()
43+ return true
44+ end
45+
46+ self .Target :Link (ent )
47+ self :GetOwner ():ChatPrint ( " Holoemitter linked to entity (" .. tostring (ent ).. " )" )
48+ end
4649 end
4750
4851 return true
You can’t perform that action at this time.
0 commit comments