Skip to content

Commit bcc6616

Browse files
committed
Fixed sound_end/theme_end signals sometimes not firing
1 parent a1ce319 commit bcc6616

File tree

8 files changed

+21
-14
lines changed

8 files changed

+21
-14
lines changed

Optional Features/#2. (Choose From This Folder Last)/Prefilled Randomized Stashes/gamedata/scripts/bind_physic_object.script

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ function generic_physics_binder:update(delta) -- called 6th
125125
end
126126
end
127127

128+
xr_sound.update(obj:id()) -- DC20231015
129+
128130
if obj_st.active_scheme then
129131
xr_logic.issue_event(nil, obj_st[obj_st.active_scheme], "update", delta)
130132
end
131-
132-
xr_sound.update(obj:id())
133133
end
134134

135135
--------------------------------------------------------------------------------

Optional Features/#2. (Choose From This Folder Last)/Prefilled Stashes/gamedata/scripts/bind_physic_object.script

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ function generic_physics_binder:update(delta) -- called 6th
125125
end
126126
end
127127

128+
xr_sound.update(obj:id()) -- DC20231015
129+
128130
if obj_st.active_scheme then
129131
xr_logic.issue_event(nil, obj_st[obj_st.active_scheme], "update", delta)
130132
end
131-
132-
xr_sound.update(obj:id())
133133
end
134134

135135
--------------------------------------------------------------------------------

SRP v1.1.4 - Readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Quest fixes:
130130
+ Fixed an onslaught of tasks being suddenly received and completed in the Abandoned Hospital if the player kills the sniper earlier than intended.
131131
+ Fixed the issue where the player could break the storyline at Agroprom by killing the Duty outpost commander while he is speaking or by leaving the map before he has finished.
132132
+ Fixed the "Help the stalkers" task in Agroprom being cancelled immediately after being received if the loner faction is hostile to the player.
133+
+ Fixed the storyline potentially breaking in saves created immediately after Sidorovich's first audio transmission to the player upon entering the Cordon.
133134
+ Fixed the storyline breaking if the player kills every stalker in the Cordon stalker base before extracting the location of Sidorovich's loot from Khaletskiy, even after paying Sidorovich to set things right with the stalkers.
134135
+ Fixed the storyline temporarily breaking if the player suppresses the Limansk military machine gun nest during the interval between receiving and completing the task to speak to the Clear Sky squad commander.
135136
+ Fixed the storyline breaking if the player speaks to Forester before responding to the SOS signal in the Red Forest.

SRP v1.1.4 - Version History.txt

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ v1.1.4
1212
+ Fixed a rare crash caused by too many stalkers trying to enter the 'Small old wagon' at the Dark Valley: smart_terrain.script:483: Insufficient smart_terrain jobs val_smart_terrain_9_6. - Decane
1313
+ Fixed a rare crash caused by too many stalkers trying to enter the 'Camp amidst rocks' at the Army Warehouses: smart_terrain.script:483: Insufficient smart_terrain jobs mil_smart_terrain_2_1 (new game required for effect). - Decane
1414
+ Fixed NPCs becoming corrupted in the rare (but possible) case where the game attempts to load their logic before initializing the player, thus creating an opportunity for save corruption. - Decane
15+
+ Fixed the issue where a sound_end and/or theme_end signal would be registered and processed in successive calls of the relevant object binder's update() routine, opening time windows in which saving the game could generate a save with stuck logic scripts. - Decane
1516
+ Fixed NPCs not settling into their sleeping animation at some sleep waypoints. - Decane
1617
+ Fixed campfire NPCs sometimes not settling into their campfire idle animation. - Decane
1718
+ Fixed sniper NPCs not settling back into their scan-for-targets state after an enemy detection timeout. - Decane

gamedata/scripts/bind_heli.script

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ function heli_binder:update(delta) -- called 6th
6565
xr_logic.initialize_obj(self.object, obj_st, self.loaded, modules.stype_heli)
6666
end
6767

68+
xr_sound.update(self.object:id()) -- DC20231015
69+
6870
if obj_st.active_scheme then
6971
xr_logic.issue_event(nil, obj_st[obj_st.active_scheme], "update", delta)
7072
end
7173

7274
self:check_health()
73-
74-
xr_sound.update(self.object:id())
7575
end
7676

7777
--------------------------------------------------------------------------------

gamedata/scripts/bind_physic_object.script

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ function generic_physics_binder:update(delta) -- called 6th
104104
end
105105
end
106106

107+
xr_sound.update(obj:id()) -- DC20231015
108+
107109
if obj_st.active_scheme then
108110
xr_logic.issue_event(nil, obj_st[obj_st.active_scheme], "update", delta)
109111
end
110-
111-
xr_sound.update(obj:id())
112112
end
113113

114114
--------------------------------------------------------------------------------

gamedata/scripts/bind_restrictor.script

+7-2
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ function restrictor_binder:update(delta) -- called 6th
9090
xr_logic.initialize_obj(self.object, obj_st, self.loaded, modules.stype_restrictor)
9191
end
9292

93+
-- DC20231015: Per https://github.com/Decane/SRP/issues/154, the xr_sound update must precede
94+
-- the active scheme update to prevent time windows wherein the game can be saved in a state
95+
-- where a sound_end/theme_end signal has been registered in scheme storage but not yet
96+
-- processed to trigger a section switch (which would only happen on the subsequent update).
97+
98+
xr_sound.update(self.object:id())
99+
93100
if obj_st.active_scheme then
94101
xr_logic.issue_event(nil, obj_st[obj_st.active_scheme], "update", delta)
95102
end
96-
97-
xr_sound.update(self.object:id())
98103
end
99104

100105
--------------------------------------------------------------------------------

gamedata/scripts/xr_motivator.script

+4-4
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ function motivator_binder:update(delta) -- called 6th
259259

260260
if npc_alive then
261261

262+
local npc_id = npc:id()
263+
264+
xr_sound.update(npc_id) -- DC20231015
265+
262266
if npc_st.active_scheme then
263267
local need_switch = true
264268
local manager = npc:motivation_action_manager()
@@ -282,10 +286,6 @@ function motivator_binder:update(delta) -- called 6th
282286
npc_st.active_sector = sr_danger.select_active_sectors(npc)
283287
npc_st.state_mgr:update()
284288

285-
local npc_id = npc:id()
286-
287-
xr_sound.update(npc_id)
288-
289289
local squad = npc_st.squad_obj
290290

291291
if squad and squad.commander_id == npc_id then

0 commit comments

Comments
 (0)