Skip to content

engineSetModelLODDistance clamped to 19999 ID range #4251

Description

@BlueEagle12

Describe the bug

Using engineSetModelLODDistance with engineRequestModel some times errors out because engineSetModelLODDistance seems to be clamped by (GetBaseIDforTXD) which in turn limits the max ID count to 19999 while engineRequestModel may sometimes push in the 20,000 or 30,000 range.

CLuaEngineDefs.cpp: 1098
if (usModelID < g_pGame->GetBaseIDforTXD())

seems to be the line causing faults.

Steps to reproduce

for i = 0,15000 do
  local model = engineRequestModel('object')
  engineSetModelLODDistance(model,500)
end

Version

No response

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions