-
-
Notifications
You must be signed in to change notification settings - Fork 500
Fix #1436: getValidPedModels() to include engineRequestModel skins as well #1437
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
Conversation
|
As a hotfix maybe you want it to go until ID 5389, because that is the last allocable skin for peds. It will skip like 1500 loops so i guess it's worth it |
Are you a 100 percent sure? Another approach would be to just: std::vector<std::vector<CClientModel*>> m_modelsByType;or an std::map, for the first one. But Im not sure if thats necessary. To be quite honest, that seems overcomplicated to me, because nobody uses this function in render(if so, then they're plain stupid). |
sbx320
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a few minor comments. Another alternative would be to only track added models (and hardcode the rest), but that'd be fragile and prone to future breakage if other model types are added.
|
Oh god, im so stupid at git, please help 🤣
while trying to run: Update: Ive googled around a bit more, and found out about -a. Now it works 😅
|
|
Is this fine as it is? My professional test method was: local testCount = 100;
local requesteds = {}
for i = 1, testCount do
requesteds[engineRequestModel("ped")] = true;
end
local found = 0;
for _, id in pairs(getValidPedModels()) do
if (requesteds[id]) then
found = found + 1
end
end
assert(found == testCount, "oh shit... here we go again!") |
|
Issues:
|
Okay, so in theory this fixes #1436 just fine.
Another way couldve been to just do this:
but i felt like that would have way bigger overhead than doing it this way. But correct me if im wrong.