Skip to content

Fix a couple things that bother me#16

Open
PennyJim wants to merge 1 commit intodanielbrauer:masterfrom
PennyJim:tweaks
Open

Fix a couple things that bother me#16
PennyJim wants to merge 1 commit intodanielbrauer:masterfrom
PennyJim:tweaks

Conversation

@PennyJim
Copy link
Copy Markdown

@PennyJim PennyJim commented Mar 9, 2026

These are just things I noticed while working on my other pr's that bothered me.

  1. calling script.on_event with an array of events. This overrides FMTK's ability to type the EventData
  2. doing floor(random()*300) instead of random(300)-1
  3. Always registering entities for on_object_destroyed despite it not actually being a lab we care about
  4. Fetching a LuaSurface after discarding it in iteration
  5. Unused field researchColor.validated
  6. Using get_technology_filtered without a filter, which is identical to just prototypes.technology
  7. Looping over a map instead of just indexing into it
  8. Using the # operator on an array you're building. A minor one, but something that still bothers me.

I would also like to add luals annotations to everything, but that's best done on top of all my changes. It also doesn't actually functionally change anything besides make it easier to work with.

@PennyJim PennyJim mentioned this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant