Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit aa78834

Browse files
committed
Fix Warp Grenade bug + move it into Tools
1 parent f737278 commit aa78834

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Techion.rte/Devices/Explosives/WarpGrenade/WarpGrenade.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ AddDevice = MOSRotating
7171
AddDevice = TDExplosive
7272
PresetName = Warp Grenade
7373
Description = This device warps its user to the location of its detonation.
74-
AddToGroup = Bombs
74+
AddToGroup = Tools
7575
Mass = 1
7676
RestThreshold = -500
7777
HitsMOs = 1

Techion.rte/Devices/Explosives/WarpGrenade/WarpGrenade.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ function Update(self)
4444
end
4545
end
4646
end
47+
local parent = self:GetParent();
48+
if parent then
49+
parent:RemoveAttachable(self, true, true);
50+
end
4751
if not self.holder:HasObject(self.PresetName) then
4852
self.holder:AddInventoryItem(CreateTDExplosive(self.PresetName));
4953
end
@@ -64,12 +68,16 @@ function Update(self)
6468
elseif self:IsActivated() then
6569
--Get the holder
6670
if self.holder == nil or self.holder.ID == rte.NoMOID then
67-
local newHolder = MovableMan:GetMOFromID(self.RootID);
71+
local newHolder = self:GetRootParent();
6872
if MovableMan:IsActor(newHolder) then
6973
self.holder = ToActor(newHolder);
70-
self.guideRadius = newHolder.Radius;
7174
end
7275
end
7376
self.fuze = Timer();
7477
end
78+
end
79+
function OnAttach(self, parent)
80+
if not self.fuze then
81+
self.guideRadius = self:GetRootParent().Radius;
82+
end
7583
end

0 commit comments

Comments
 (0)