Soft changes to item + entity + LBM + ABM registration, return of definition table on success#17009
Open
TubberPupper wants to merge 3 commits intoluanti-org:masterfrom
Open
Soft changes to item + entity + LBM + ABM registration, return of definition table on success#17009TubberPupper wants to merge 3 commits intoluanti-org:masterfrom
TubberPupper wants to merge 3 commits intoluanti-org:masterfrom
Conversation
…ition, start concept of reusing `core.get_current_modname()` instead of calling it twice
…and entities (the definition tables)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(I don't imagine I was supposed to just copy the template, but, I'm tired and lazy RN :wheeze:)
Goal of the PR
Add a more informative error for if an invalid
itemdefis given for the wrapper variants ofregister_itemHave
get_current_modnamebe called once instead of twice per registration, reuse forcheck_modname_prefix(might even make it quicker???)Return the definition tables upon successful registration
How does the PR work?
Well, as described in the goal of the PR! :D
Does it resolve any reported issue?
To my knowledge, no. It was a pet peeve of mine to see
itemdef.type =in the wrapper with no check for if it's a table. I was about to do similar for all other registration as well but thought "hmmm, maybe there's a reason, like performance?"Does this relate to a goal in the roadmap?
From what I quickly read, no, it does not relate to any engine goals
If not a bug fix, why is this PR needed? What usecases does it solve?
Make a more informative error, use
get_current_modnameless if unnecessary, QoL with returning definition table on successIf you have used an LLM/AI to help with code or assets, you must disclose this.
None at all :3c
To do
This PR is Ready for Review.
How to test
Just register any item, entity, LBM, or ABM :D - should expect a return from them as well
Should this returning of the definition on success be documented?