Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createBuilding crash 0xFFFFFFFF #3430

Closed
1 task done
Xenius97 opened this issue Jun 4, 2024 · 1 comment
Closed
1 task done

createBuilding crash 0xFFFFFFFF #3430

Xenius97 opened this issue Jun 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Xenius97
Copy link
Contributor

Xenius97 commented Jun 4, 2024

Describe the bug

I get a randomly crash after using createBuilding
Dump:
https://mega.nz/file/sdhlFACA#T6o5qMQw6w9ELo9qS3WGcNO9GrLAKsUAms9bq5kq92A

Maybe similar to #3329

Steps to reproduce

Use this this simple script:

function assignLOD(element, loddistance)
	local lod
	local x, y, z = getElementPosition(element)
	local rx, ry, rz = getElementRotation(element)
	if getElementType(element) == "object" then
		lod = createObject(getElementModel(element), x, y, z, rx, ry, rz, true)
		setElementDimension(lod,getElementDimension(element))
		setElementCollisionsEnabled(lod,false)
		setLowLODElement(element,lod)
	else
		lod = createBuilding(getElementModel(element), x, y, z, rx, ry, rz)
		if lod then
			setLowLODElement(element, lod)
		end
	end
	if (loddistance) then
		engineSetModelLODDistance(getElementModel(element), loddistance)
	end
    return lod
end

function removeAndCreate(model, lod, x, y, z, rx, ry, rz, double, building)
	removeWorldModel(model, 10000, 0, 0, 0)
	if lod then
		removeWorldModel(lod, 10000, 0, 0, 0)
	end
	
	if building and buildingsEnabled then
		if double then
			engineSetModelFlag(model, "disable_backface_culling", true)
		end
		local obj = createBuilding(model, x, y, z, rx or 0, ry or 0, rz or 0)
		if obj then
			assignLOD(obj)
		end
	else
		local obj = createObject(model, x, y, z, rx, ry, rz)
		if obj then
			setElementDimension(obj, -1)
			if double then
				setElementDoubleSided(obj, true)
			end
			assignLOD(obj)
		end
	end
end

Version

1.6-release-22485.0.000

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@Xenius97 Xenius97 added the bug Something isn't working label Jun 4, 2024
@Xenius97
Copy link
Contributor Author

Didnt happen since that, i will reopen if happens again

@Xenius97 Xenius97 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant