multitheftauto / amx

MTA AMX compatibility layer.
zlib License
31 stars 8 forks source link

Inefficient garage opening code #11

Open qaisjp opened 4 years ago

qaisjp commented 4 years ago

https://github.com/multitheftauto/amx/blob/3330655c1c388adc4e97ec365cbb9b644a99445e/amx/client/garages.lua

It should use a colshape, as shown here in the setGarageOpen example.

Could generate colshape based on garage size, but it might be easier to use a colsphere + a static radius.

theSpool commented 4 years ago

It would also be faster to store the 50 garage's positions in a table rather than calling the function repeatedly, right?