Jump to content

LUA function destroy() + unit from world.searchObjects + client == crash


Recommended Posts

Posted

local function RemoveUnit(unit)
unit:destroy()
end

local SearchArea = {
id = world.VolumeType.SPHERE,
params = {
	point = {
		x = -300000,
		y = 0,
		z = 700000
	},
	radius = 500000
}
}
world.searchObjects(Object.Category.UNIT, SearchArea, RemoveUnit)

 

Executing the above code (searching units and destroying them) crashes the host when another client is involved. Code works as expected for AI units, for the player in SP and for the host if he is alone in MP. As soon as a second human client is in the mission, destroy() crashes the server.

 

Sample mission for reproduction attached.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...