-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move bionic_data to generic_factory #40155
Conversation
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/bionics-json-and-inheritance-override/23543/2 |
Fixes #37476 (stale). |
void finalize_bionics() | ||
{ | ||
for( const std::pair<const bionic_id, bionic_data> &bio : bionics ) { | ||
if( bio.second.upgraded_bionic ) { | ||
bionics[ bio.second.upgraded_bionic ].available_upgrades.insert( bio.first ); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How were you able to remove the finalization step without changing the bionics json? I feel like you should still need some code like this somewhere, but I don't see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because the only thing in the repo using this is the obsolete reactor CBM. But I should probably add an entry about it to the doc though.
Summary
SUMMARY: Infrastructure "Move bionic_data to generic_factory"
Purpose of change
Modernise bionic code and should enable
copy-from
for CBMsDescribe the solution
Move bionic_data to generic_factory
Get rid of get_bool_or_flag implementation in favor of flags
Implement flags
Describe alternatives you've considered
Testing
Instal finger laser and power bank MK II
Shoot zombies
No problem
Create an override of Air filtration system using copr-from
Replace 7 mouth protection by 70 eyes protection in env_protect
Get a CBM with 70 eyes Ep
Try again but just change the name
Spawn and install the CBM and have only the name change
Make another CBM with a new id and use copy from
The CBM has the properties of the copied from bionic
Additional context
Using clear() in load_bionic for stdd::map is not super elegant
Also just making a new CBM, in a mod, with the same id as a vanilla one without copy from seem to work without errors, I don't know if that's a problem.