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

play: refactor

Open sacr1ficez opened this issue 4 years ago • 6 comments

Refactored play gamemode.

  • Fixed memory leaks (timer/vehicle data never got cleared from table upon destroying).
  • Optimised code.
  • Disabled OOP (it's not worth to use it for some simple methods, considering that it affects script performance just by enabling it in meta).
  • Improved readability.
  • Logic has been separated per parts, so it will be easier to maintain/work on.

Tested briefly, hope that i didn't missed anything. Would be nice if someone could test it as well.

sacr1ficez avatar Nov 02 '21 05:11 sacr1ficez

I think it's better to move datasets out, like dataset.lua with arrays. Player array shouldn't be one liner.

Disinterpreter avatar Nov 02 '21 07:11 Disinterpreter

Moved them to play_config.lua, and fixed one liner. Do you also need for playerSkins to not be one liner?

sacr1ficez avatar Nov 02 '21 07:11 sacr1ficez

Do you also need for playerSkins to not be one liner?

yes

Disinterpreter avatar Nov 02 '21 07:11 Disinterpreter

Done & waiting for further feedback.

sacr1ficez avatar Nov 02 '21 11:11 sacr1ficez

@TheNormalnij, @jlillis updated, re-review please.

sacr1ficez avatar Nov 16 '21 12:11 sacr1ficez

LGTM. We need test it before merge.

TheNormalnij avatar Nov 16 '21 21:11 TheNormalnij

Thank you.

patrikjuvonen avatar Dec 29 '22 20:12 patrikjuvonen