Skip to content

Add heading to enginePreloadWorldArea, extract (some of) LoadScene logic - #5496

Open
Timic3 wants to merge 1 commit into
multitheftauto:masterfrom
Timic3:feature/preload-world-area-heading
Open

Timic3 wants to merge 1 commit into
multitheftauto:masterfrom
Timic3:feature/preload-world-area-heading

Conversation

@Timic3

@Timic3 Timic3 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request adds an optional heading argument to the existing enginePreloadWorldArea, and stops it from calling the game's CStreaming::LoadScene/LoadSceneCollision. Previously, it called the game's CStreaming::LoadScene directly, which besides "preloading the area" also:

  1. Unloaded every streamed in object in the game
  2. Dropped all pending model requests
  3. Loaded zone vehicle models, cop models and path nodes for the area
  4. Loaded radar tiles for the area - I did not include it in this PR due to unloading the tiles for current position, causing the radar to flicker
enginePreloadWorldArea(float x, float y, float z [, string loadingOption = "all", float heading = nil])

NOTE: This will only load models in the specified heading, not collisions!

Motivation

For Sphene project (single player in MTA) we needed to load a world area in specific direction, like LOAD_SCENE_IN_DIRECTION does in SCM.

Test plan

Some examples, extracted from the SCM:

2026-10-06.20-25-43.mp4

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@MegadreamsBE MegadreamsBE added the enhancement New feature or request label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants