mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

IsValidModel should be changed

Open Allerek opened this issue 6 years ago • 9 comments

Version nightly 1.5.8-20716 onwards

Additional context #IMPORANT: I'm C++ Amateur, what im saying can be a complete CRAP!#

For now IsValidModel in Client\mods\deathmatch\logic\CVehicleNames.cpp returns true only if we check for standard GTA:SA models. ulModel >= 400 && ulModel <= 611;

We should change it to use

getModelInfo(ulModel)->isVehicle();

in order to return real values when using vehicles from engineRequestModel.

This will allow us to add functions from #1175

Allerek avatar Nov 18 '20 19:11 Allerek

^^Not a bug if thinking more, but can cause problems in future versions

Allerek avatar Nov 18 '20 19:11 Allerek

Seems reasonable.

Pirulax avatar Nov 21 '20 03:11 Pirulax

We need good vehicle manager with dynamic id support first

TheNormalnij avatar Nov 23 '20 11:11 TheNormalnij

I think all these CClientVehicle::IsValidModel and such functions should be moved to CClientModelManager, so for example.: IsVehicleModel would be an alias for GetModelType() == eClientModelType::VEHICLE, same for peds, and objects.

Pirulax avatar Nov 26 '20 01:11 Pirulax

CModelInfoSA is valid model manager. CClientModelManager is only manager for allocated ID's

TheNormalnij avatar Nov 26 '20 07:11 TheNormalnij

Yes I know, but I'd like to use CCLientModelManger as we'll have to support custom model names as well.

Pirulax avatar Nov 26 '20 12:11 Pirulax

@BCG2000 sorry for the tag but do you think this still needs to be resolved?

Fernando-A-Rocha avatar Nov 11 '21 00:11 Fernando-A-Rocha

This can only be fixed when https://github.com/multitheftauto/mtasa-blue/issues/2251 is implemented, as revamping functions like this one is part of implementing it. Until then, modifying these functions individually should be avoided, since that is only working around the root issue instead of directly addressing it.

BCG2000 avatar Nov 11 '21 00:11 BCG2000

This can only be fixed when https://github.com/multitheftauto/mtasa-blue/issues/2251 is implemented, as revamping functions like this one is part of implementing it. Until then, modifying these functions individually should be avoided, since that is only working around the root issue instead of directly addressing it.

Just as I thought! I have the same opinion. I think we have enough temporary solutions for new vehicle models to work. We'll get the best of it once server side allocation is a thing.

Fernando-A-Rocha avatar Nov 11 '21 01:11 Fernando-A-Rocha