This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Techion.rte/Devices/Explosives/WarpGrenade Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ AddDevice = MOSRotating
71
71
AddDevice = TDExplosive
72
72
PresetName = Warp Grenade
73
73
Description = This device warps its user to the location of its detonation.
74
- AddToGroup = Bombs
74
+ AddToGroup = Tools
75
75
Mass = 1
76
76
RestThreshold = -500
77
77
HitsMOs = 1
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ function Update(self)
44
44
end
45
45
end
46
46
end
47
+ local parent = self :GetParent ();
48
+ if parent then
49
+ parent :RemoveAttachable (self , true , true );
50
+ end
47
51
if not self .holder :HasObject (self .PresetName ) then
48
52
self .holder :AddInventoryItem (CreateTDExplosive (self .PresetName ));
49
53
end
@@ -64,12 +68,16 @@ function Update(self)
64
68
elseif self :IsActivated () then
65
69
-- Get the holder
66
70
if self .holder == nil or self .holder .ID == rte .NoMOID then
67
- local newHolder = MovableMan : GetMOFromID ( self . RootID );
71
+ local newHolder = self : GetRootParent ( );
68
72
if MovableMan :IsActor (newHolder ) then
69
73
self .holder = ToActor (newHolder );
70
- self .guideRadius = newHolder .Radius ;
71
74
end
72
75
end
73
76
self .fuze = Timer ();
74
77
end
78
+ end
79
+ function OnAttach (self , parent )
80
+ if not self .fuze then
81
+ self .guideRadius = self :GetRootParent ().Radius ;
82
+ end
75
83
end
You can’t perform that action at this time.
0 commit comments