Skip to content

Commit b66c74b

Browse files
committed
fix: bug with non-spatialized soundscript writing when no entity is found
1 parent e3356cf commit b66c74b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/template_class.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def GetSoundscript(self):
154154
out += TAB2 + '"update_stack" {\n'
155155
if self.map and self.speaker:
156156
out += TAB3 + f'"import_stack" "update_dialog_spatial_{self.actor}"\n'
157-
out += TAB3 + '"position_array" {\n'
158157

159158
ents = self.ctx.GetMapEnts(self.map).search(self.speaker)
160159
ents = list(ents)
@@ -163,7 +162,6 @@ def GetSoundscript(self):
163162
LOGGER.Warning(f"No specified speaker targets found in map {self.map} for {self.name}! Cannot spatialize sound, falling back to actor only.")
164163

165164
# Fallback to unspatialized
166-
out += TAB3 + f'"import_stack" "update_dialog_spatial_{self.actor}"\n'
167165
out += TAB2 + "}\n"
168166
out += TAB + "}\n"
169167
out += "}\n"
@@ -173,6 +171,7 @@ def GetSoundscript(self):
173171
LOGGER.Error(f"Cannot have more than 7 targets!")
174172
raise RuntimeError
175173

174+
out += TAB3 + '"position_array" {\n'
176175
out += TAB4 + f'"input_entry_count" "{len(ents) + 1}"\n'
177176

178177
i = 1

0 commit comments

Comments
 (0)