Describe the bugCModelInfoSA::IsValid has mixed logic, where any model ID between 20000 and MODELINFO_MAX is always considered valid. This causes a problem because it seems interface isn't always initialized (correctly)? Calling certain model info using a model ID (i.e. 20000) results in a crash (see #446 for crash info).
As far as I'm aware, (and in the IDB i'm using), 20000 is original size of that array in gta sa, trying to change physical properties of anything above that crashes the client. I think the additional space reserved in CGameSA (up to 26000) was made either by mistake, or in case of mta team wanting to expand some limits.
Describe the bug
CModelInfoSA::IsValid
has mixed logic, where any model ID between 20000 andMODELINFO_MAX
is always considered valid. This causes a problem because it seems interface isn't always initialized (correctly)? Calling certain model info using a model ID (i.e. 20000) results in a crash (see #446 for crash info).See https://github.com/multitheftauto/mtasa-blue/blob/master/Client/game_sa/CModelInfoSA.cpp#L517
To reproduce
Expected behaviour Properly return false if the ID is not actually valid.
Version 1.5.6-release-16542.0.000
Additional context
usModelID < 20000
) outsideCModelInfoSA
in the future, asCModelInfoSA::IsValid
should return correct status.https://github.com/multitheftauto/mtasa-blue/pull/299#issuecomment-416843826 @qaisjp commented:
https://github.com/multitheftauto/mtasa-blue/pull/299#issuecomment-418256833 @Sergeanur commented:
https://github.com/multitheftauto/mtasa-blue/pull/784#issuecomment-466710930 @forkerer commented: