Author Topic: [0.26] xsotantransformed sector generator removes all sector scripts  (Read 40 times)

Rinart73

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    344
  • Discord: Rinart73#7304
    • View Profile
Avorion: 0.26

During "xsotantransformed.lua" sector generation it picks random generator script, executes it and then destroys everything so it looks like it was an actual sector before. The problem is this part of the code (line 176-178):
Code: [Select]
for _, script in pairs(sector:getScripts()) do
    sector:removeScript(script)
end

It removes ALL scripts, even the ones that shouldn't be removed like relationchanges, spawnpersecutors, boardingutility, warzonecheck and radiochatter+ modded scripts that should be persistent.

My suggestion is replacing that code with this one:

Code: [Select]
for _, script in pairs(sector:getScripts()) do
    sector:removeScript(script)
end
-- restore basic scripts
include("data/scripts/sector/init.lua")

This way sector will get back it's persistent scripts.