Joe91 / fun-bots

A highly customizable and configurable bot mod for your Venice Unleashed Battlefield 3 server.
https://discord.gg/zNk3qCzk6x
237 stars 45 forks source link

fix: return value of `RegistryManager:Get` method #249

Closed joao-vitor-souza closed 1 year ago

joao-vitor-souza commented 1 year ago

I used the configs in .editorconfig on my Lua extension in VSCode and formatted these files, didn't change anything in the code (only style), except that:

In Registry.lua and ClientBotManager.lua I fixed the grammar of this variable: USE_COLLITION_RAYCASTS -> USE_COLLISION_RAYCASTS, and some other grammar stuff on comments;

In both RegistryManager.lua and RegistryUtil.lua I standardized the notation of these files with the other ones, like self._VariableName;

In ArrayMap.lua I simplified the for loops comparing the data of self._Entries with the passed argument directly;

Last, I fixed the RegistryManager:Get method, it was never returning the variable value, even when value ~= nil, it returned default. This method is used no where, but now it'll work properly if it's needed.

Joe91 commented 1 year ago

The thing with g_RegistryManager is something else. Since there is no local or so this is a global variable. This way you only have one instance of the Registry Manger and not one for every component that uses it. We should revert that again. Does this make sense for you? The other things are great improvements!

FlashHit commented 1 year ago

switch back to tab spaces. there is no way to review this properly now. ^^