Skip to content
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

refactor drop activity and associated functions #36205

Merged
merged 3 commits into from
Dec 30, 2019

Conversation

KorGgenT
Copy link
Member

Summary

SUMMARY: Infrastructure "refactor drop activity and associated functions"

Purpose of change

This is the largest portion of the refactoring of game::inventory_item_menu, in order to convert usage to item_location from int pos

Describe the solution

This was a bit of a rabbithole: i started by changing the drop functions. that led me to the drop activities, and then finally the inventory selectors for dropping. It cause me to change the player member of the inventory selectro from const, and there is at least 1 const_cast from item * in order to be able to utilize it in an item_location. the const_cast is supposed to be temporary, and refactored again, but that would likely be even more refactoring.
I have also tried to kill auto in any areas that were near the code i touched.

Testing

dropped various items, multidrop and regular drop.

Additional context

@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Dec 18, 2019
@kevingranade kevingranade merged commit 1c9dafc into CleverRaven:master Dec 30, 2019
@KorGgenT KorGgenT deleted the refactor-drop branch December 30, 2019 02:26
} );

if( iter == worn.end() ) {
// TODO: Use a calculated cost
worn.emplace_front( dit, dit->count(), 100 );
const item_location loc( p, dit );
act_item act( loc, loc->count(), loc.obtain_cost( p, loc->count() ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lines seems to have no effect. It creates an act_item object named act, but that object is never used. It's constructor does not have side effects and the functions called to obtain the parameters also have no side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants