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

Commit ba41290

Browse files
committed
Show correct item frame in Visible Inventory + misc cleanup
1 parent 37e0df8 commit ba41290

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Base.rte/AI/HumanFunctions.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ function HumanFunctions.DoVisibleInventory(actor, showAll)
149149
if item.ClassName == "TDExplosive" then
150150
thrownCount = thrownCount + 1;
151151
elseif item.ClassName == "HDFirearm" or item.ClassName == "HeldDevice" then
152-
if showAll or item.Radius + item.Mass > largestItem then
153-
largestItem = item.Radius + item.Mass;
152+
if showAll or item.Diameter + item.Mass > largestItem then
153+
item = ToMOSprite(item);
154+
largestItem = item.Diameter + item.Mass;
154155
heldCount = heldCount + 1;
155156
local itemCount = math.sqrt(heldCount);
156157

@@ -159,7 +160,7 @@ function HumanFunctions.DoVisibleInventory(actor, showAll)
159160
--Bigger actors carry weapons higher up, smaller weapons are carried lower down
160161
local drawPos = actor.Pos + Vector((-actorBack.X * 0.5 - stackX) * actor.FlipFactor, -actorBack.Y * 0.75):RadRotate(actor.RotAngle);
161162
--Display tall objects upright
162-
local widthToHeightRatio = ToMOSprite(item):GetSpriteWidth()/ToMOSprite(item):GetSpriteHeight();
163+
local widthToHeightRatio = item:GetSpriteWidth()/item:GetSpriteHeight();
163164
local orientation = widthToHeightRatio > 1 and 1.57 * actor.FlipFactor or 0;
164165

165166
local tilt = (itemCount/item.Radius) * widthToHeightRatio * actor.FlipFactor;
@@ -168,7 +169,7 @@ function HumanFunctions.DoVisibleInventory(actor, showAll)
168169
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
169170
local screen = ActivityMan:GetActivity():ScreenOfPlayer(player);
170171
if screen ~= -1 and not SceneMan:IsUnseen(drawPos.X, drawPos.Y, ActivityMan:GetActivity():GetTeamOfPlayer(player)) then
171-
PrimitiveMan:DrawBitmapPrimitive(screen, drawPos, item, rotAng, 0, actor.HFlipped, true);
172+
PrimitiveMan:DrawBitmapPrimitive(screen, drawPos, item, rotAng, item.Frame, actor.HFlipped, true);
172173
end
173174
end
174175
end

Base.rte/Actors/Shared.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ AddEffect = AEmitter
417417
BurstSpacing = 920
418418
BurstScale = 1
419419
BurstTriggered = 1
420-
EmissionDamage = 0
421-
Flash = None
422-
FlashOnlyOnBurst = 0
423420
LoudnessOnEmit = 0.1
424421

425422

0 commit comments

Comments
 (0)