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

Commit eb4b9f2

Browse files
committed
Minor lua edits and fixes
1 parent ac81ae9 commit eb4b9f2

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ function Update(self)
2121
local jointOffset = Vector(self.JointOffset.X * self.FlipFactor, self.JointOffset.Y):RadRotate(self.RotAngle);
2222
self.Pos = self.Pos - jointOffset + Vector(jointOffset.X, jointOffset.Y):RadRotate(-self.setRecoilAngle * self.FlipFactor);
2323
if self.recoilStanceFactor ~= 0 then
24-
local setStanceAngle = self.setRecoilAngle * self.recoilStanceFactor;
25-
self.StanceOffset = Vector(self.origStanceOffset.X, self.origStanceOffset.Y):RadRotate(setStanceAngle);
26-
self.SharpStanceOffset = Vector(self.origSharpStanceOffset.X, self.origSharpStanceOffset.Y):RadRotate(setStanceAngle);
24+
local setStanceAngle = self.setRecoilAngle * self.recoilStanceFactor * 0.5;
25+
local xFactor = 1 + setStanceAngle * 0.5;
26+
self.StanceOffset = Vector(self.origStanceOffset.X/xFactor, self.origStanceOffset.Y):RadRotate(setStanceAngle);
27+
self.SharpStanceOffset = Vector(self.origSharpStanceOffset.X/xFactor, self.origSharpStanceOffset.Y):RadRotate(setStanceAngle);
2728
end
2829
end

Base.rte/Effects/Pyro/Flame/Flame.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function Update(self)
4242

4343
self.targetStickAngle = mo.RotAngle;
4444
self.stickPos = SceneMan:ShortestDistance(mo.Pos, self.Pos, SceneMan.SceneWrapsX) * 0.8;
45-
self.Pos = mo.Pos + Vector(self.stickPos.X, self.stickPos.Y);
4645
end
4746
elseif not self.isShort and math.random() < 0.1 then
4847
--Spawn another, shorter flame particle occasionally

Browncoats.rte/Devices/Explosives/FuelBomb/FuelBomb.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ function Update(self)
4242
end
4343
local partsLeft = 0;
4444
for i = 1, #self.partList do
45-
if MovableMan:IsParticle(self.partList[i]) and self.partList[i].PresetName == "Browncoat Fuel Bomb Fuel" then
45+
if self.partList[i] and MovableMan:IsParticle(self.partList[i]) and self.partList[i].PresetName == "Browncoat Fuel Bomb Fuel" then
4646
if self.explodeTimer:IsPastSimMS(self.explodeTime + self.partList[i].queue) then
4747
local fire = CreatePEmitter("Flame ".. math.random(2) .." Hurt");
4848
fire.Pos = Vector(self.partList[i].Pos.X, self.partList[i].Pos.Y);
4949
fire.Vel = self.Vel;
50-
if self.partList[i].target then
50+
if self.partList[i].target and self.partList[i].target.ID ~= rte.NoMOID and not self.partList[i].target.ToDelete then
5151
fire.Pos = self.partList[i].target.Pos + self.partList[i].stickPos;
5252
fire.Vel = Vector(-self.partList[i].stickPos.X, -self.partList[i].stickPos.Y);
5353
fire.Sharpness = self.partList[i].target.ID * 0.001;
@@ -81,9 +81,9 @@ function Update(self)
8181
else
8282
--Look for targets to douse with fuel
8383
for i = 1, #self.partList do
84-
if MovableMan:IsParticle(self.partList[i]) and self.partList[i].PresetName == "Browncoat Fuel Bomb Fuel" then
84+
if self.partList[i] and MovableMan:IsParticle(self.partList[i]) and self.partList[i].PresetName == "Browncoat Fuel Bomb Fuel" then
8585

86-
if self.partList[i].target and IsMOSRotating(self.partList[i].target) and self.partList[i].target.ID ~= rte.NoMOID then
86+
if self.partList[i].target and self.partList[i].target.ID ~= rte.NoMOID and not self.partList[i].target.ToDelete then
8787

8888
if math.random() < 0.01 then
8989
self.partList[i].Vel = self.partList[i].target.Vel;
@@ -106,6 +106,8 @@ function Update(self)
106106
end
107107
end
108108
end
109+
else
110+
self.partList[i] = nil;
109111
end
110112
end
111113
end

Browncoats.rte/Devices/Weapons/Magmaul/MagmaulFuelBomb.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Update(self)
2828
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
2929
if moCheck ~= rte.NoMOID then
3030
local actor = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck).RootID);
31-
if actor.Team ~= self.Team then
31+
if actor and actor.Team ~= self.Team then
3232
self:GibThis();
3333
end
3434
end

Dummy.rte/Devices/Weapons/Destroyer/DestroyerCannon.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function Update(self)
8484
par.Team = self.Team;
8585
par.IgnoresTeamHits = true;
8686
par.Pos = self.MuzzlePos;
87-
par.Vel = Vector(math.max(self.maxFireVel * self.charge, self.minFireVel) * self.FlipFactor, 0):RadRotate(self.RotAngle);
87+
par.Vel = Vector((self.minFireVel + (self.maxFireVel - self.minFireVel) * self.charge) * self.FlipFactor, 0):RadRotate(self.RotAngle);
8888
MovableMan:AddParticle(par);
8989

9090
self.charge = 0;

0 commit comments

Comments
 (0)