Skip to content

Commit

Permalink
Worked around Dunin ammo vanishing regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Decane committed Nov 12, 2022
1 parent ea50273 commit 4b4a2b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SRP v1.1.4 - Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ Credits:

• Content contributions:

AMK Team, angrydog, Angus McFisticuffs, Anonymous, antifrost, Armada, Artos, Atempad,
Alex Rinic, AMK Team, angrydog, Angus McFisticuffs, Anonymous, antifrost, Armada, Artos, Atempad,
b1ub4k, barin, BobBQ, burger, Canzah, castl, CeeJay.dk, Control volume, Danila_STALKER,
dDefinder, Decane, DerHeiligeApfel, DEXXX, Fangion, Gosuke, GSC Game World, IG2007,
InnerGround, jjwalker (Cameron Sneed), Kill_the_Strelok, Lebedev88, Lobstris, MacroN, Marked_2,
Expand Down
1 change: 1 addition & 0 deletions SRP v1.1.4 - Version History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ v1.1.4
+ Fixed an SRP v1.1.3 regression that caused some NPCs to keep repeating their goodbye phrase ad nauseum until the player faces away from them after closing their dialogue window. - Decane
+ Fixed an SRP v1.0.4 regression that caused several dialogue options to be erroneously unavailable when speaking to generic mercenary NPCs, including Hog's subordinates at the Army Warehouses and Leshiy's subordinates at the Red Forest. - Decane
+ Fixed an SRP v1.0.3 regression that caused Yoga's walkie-talkie transmissions to the player to sound as if Yoga were speaking to the player in person rather than over walkie-talkie. - Decane
+ Worked around an SRP v1.0.3 regression introduced by the Dunin Ammo Aggregation mod that caused ammo unloaded from a weapon to disappear under certain circumstances. - Decane, Alex Rinic
+ Worked around an SRP v1.0.3 regression that caused bullet tracers to be visible through geometry when playing in DX10/10.1 mode with anti-aliasing enabled through the game's graphics settings. Note: This was achieved by reintroducing the bug from the unmodded game of tracers not being visible at all in DX10/10.1 mode.
+ Fixed an SRP v0.5 regression that caused DX9 sun shafts quality to be hard-coded to low.
+ Added a 'Move to Backpack'/'Attach to Belt' option to the menu that appears when right-clicking a detector in the inventory. - Lebedev88
Expand Down
20 changes: 12 additions & 8 deletions gamedata/scripts/dunin_ammo.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local ammo_data_table = {}
local repack_needed = false
local updates_before_repack = nil
local actor = db.actor
local sim = _G.sim

Expand Down Expand Up @@ -51,14 +51,18 @@ local function repack_ammo(section, box_size)
end

function on_update()
if repack_needed then
for section, ammo_data in pairs (ammo_data_table) do
if ammo_data.repack_needed then
repack_ammo(section, ammo_data.box_size)
ammo_data.repack_needed = false
if updates_before_repack then
if updates_before_repack > 0 then
updates_before_repack = updates_before_repack - 1
else
for section, ammo_data in pairs (ammo_data_table) do
if ammo_data.repack_needed then
repack_ammo(section, ammo_data.box_size)
ammo_data.repack_needed = false
end
end
updates_before_repack = nil
end
repack_needed = false
end
end

Expand Down Expand Up @@ -88,7 +92,7 @@ function on_take(ammo)
if not ammo_data.repack_needed then
if box_size ~= get_ammo_count(ammo:id()) then
ammo_data.repack_needed = true
repack_needed = true
updates_before_repack = 150 -- hack per https://github.com/Decane/SRP/issues/150
end
end
end
Expand Down

0 comments on commit 4b4a2b1

Please sign in to comment.