Skip to content

Use this feature to retrieve only Glide vehicles, not all server entities#298

Closed
Vitroze wants to merge 1 commit into
StyledStrike:mainfrom
Vitroze:ents_iterator
Closed

Use this feature to retrieve only Glide vehicles, not all server entities#298
Vitroze wants to merge 1 commit into
StyledStrike:mainfrom
Vitroze:ents_iterator

Conversation

@Vitroze

@Vitroze Vitroze commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

It's better to use the glide function, which retrieves only glide vehicles, rather than retrieving all entities on the server.

Even though this feature is rarely used, it's still a form of micro-optimization.

@StyledStrike

StyledStrike commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Do not use Glide.GetAllVehicleEntities on ResetAll. On single-player map changes, the Lua environment is recreated, so the list of vehicles that function is keeping track of is empty.

Technically, the vehicle entities already exists before Lua starts, and handing the quirks that comes from that is why ResetAll exists in single-player on the first place.

@Vitroze

Vitroze commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Under what circumstances can glide vehicles be present in the PreCleanupMap?

I tried with the original code and my modification, but in my tests, no glide vehicles were present.

@StyledStrike StyledStrike added the invalid This doesn't seem right label Jun 7, 2026
@StyledStrike

Copy link
Copy Markdown
Owner

Yeah, the EntityRemoved hook runs before PreCleanupMap. Closing this PR for now since we can't use Glide.GetAllVehicleEntities in there, or in ResetAll.

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

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants