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

Commit 5f6c61f

Browse files
committed
Minor script tweaks
1 parent d9901e5 commit 5f6c61f

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

Base.rte/AI/NativeHumanAI.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,11 @@ function NativeHumanAI:Update(Owner)
349349
local dist = SceneMan:ShortestDistance(Owner.Pos, Leader.Pos, false).Largest
350350
local radius = (Leader.Height + Owner.Height) * 0.5
351351
if dist < radius then
352-
--if Leader:IsPlayerControlled() then
353352
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_CROUCH}
354353
for _, control in pairs(copyControls) do
355354
local state = Leader:GetController():IsState(control)
356355
self.Ctrl:SetState(control, state)
357356
end
358-
--end
359357
if Leader.EquippedItem then
360358

361359
if IsHDFirearm(Leader.EquippedItem) then
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
function Update(self)
2-
if self.RoundInMagCount == 0 then
3-
local actor = MovableMan:GetMOFromID(self.RootID);
4-
if MovableMan:IsActor(actor) then
5-
self:Reload();
6-
end
2+
if self.RoundInMagCount == 0 and IsActor(self:GetRootParent()) then
3+
self:Reload();
74
end
85
end

Base.rte/Devices/Shared/Scripts/BurstFire.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Create(self)
2-
self.shotsPerBurst = 3;
2+
self.shotsPerBurst = self:NumberValueExists("ShotsPerBurst") and self:GetNumberValue("ShotsPerBurst") or 3;
33
self.coolDownDelay = (60000/self.RateOfFire) + 100;
44
end
55
function Update(self)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
function ToggleDualWield(actor)
2-
local gun = ToAHuman(actor).EquippedItem;
3-
if gun and IsHDFirearm(gun) then
4-
local isDualWieldable = ToHDFirearm(gun):IsDualWieldable();
5-
ToHDFirearm(gun):SetDualWieldable(not isDualWieldable);
6-
ToHDFirearm(gun):SetOneHanded(not isDualWieldable);
2+
local device = ToAHuman(actor).EquippedItem;
3+
if device and IsHeldDevice(device) then
4+
local isDualWieldable = ToHeldDevice(device):IsDualWieldable();
5+
ToHeldDevice(device):SetDualWieldable(not isDualWieldable);
6+
ToHeldDevice(device):SetOneHanded(not isDualWieldable);
77
end
88
end

0 commit comments

Comments
 (0)