Open-GTO / foreach

foreach standalone include (non y_iterate version)
Other
22 stars 8 forks source link

Fix omp compatibility #21

Closed NexiusTailer closed 6 months ago

NexiusTailer commented 6 months ago

This mainly fixes the way it consider open.mp presence: previous checks were about compile-time detection so that it only could work properly if you use omp-stdlib with open.mp server. But since omp-stdlib makes various problems and illogical stuff (for example, like this or whatever else), many prefer running omp server with samp libraries. So, the changes are about that now it won't directly check for omp libraries, but still will be running correctly on both samp and omp server.

  1. GetPlayerPoolSize / GetVehiclePoolSize / GetActorPoolSize were completely removed. Yes, they are much better than using just MAX_PLAYERS, but the loops which contain it are used at init only, so it shouldn't be a big problem exactly in our case.
  2. Bool tagged parameter addsiren in CreateVehicle and AddStaticVehicleEx now is converted into a bool much more elegantly (by logical !! operation when it passed into the next hook, so it still will be valid for canonical samp libs and keep working correctly without a warning under omp libs where bool tag was added).
ziggi commented 6 months ago

Yeah, looks good.

for example, like https://github.com/openmultiplayer/omp-stdlib/issues/26 or whatever else

Looks weird. By my opinion, SetVehicleParamsEx should be separated to SetVehicleEngine, SetVehicleLights, etc. and then something like like undefined wouldn't be needed.