-
-
Notifications
You must be signed in to change notification settings - Fork 488
0009139: fix invalid model ID in engine LOD functions cause a crash #299
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
0009139: fix invalid model ID in engine LOD functions cause a crash #299
Conversation
Now that I think of it, are these supposed to support vehicle and ped models too? |
does it work with vehicle and ped models? |
Seems like it does. I'll add those model checks in as well. |
What kind of crash is caused, and where does it crash? pModelInfo is currently (or should be) returning If there is an underlying bug with |
It doesn't crash with invalid modelID, it just returns false. |
This bug seems to be associated with https://github.com/multitheftauto/mtasa-blue/pull/155/files. It returns true on this line: https://github.com/multitheftauto/mtasa-blue/pull/155/files#diff-3beea7b726cdd57f96a6d8226af4eb9fR538 Removing the offending line does not fix the problem. Returning |
I don't quite remember, but I think CModelInfoSA::IsValid was used on animation request, so return true was required. |
I guess another option is to mark any 20000+ invalid (or make a separate IsValid method that doesn't care if it's 20000+...) This is what I've been able to find out so far: If the name starts with "txd", assume it's refering to a global txd. (https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/CModelNames.cpp#L10480) Encode global txd as model id 20000+ (https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/CModelNames.cpp#L10498) So some "global txd" is what 20000+ ids are, then causes a crash. No actual model has an id of 20000+ so I mean it must be related to some other internal SA fact how things work. EDIT:
|
Mantis Bug Tracker issue
9139, fixes #446
Summary: