Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upNo magazines mod #15490
Conversation
kevingranade
added some commits
Feb 19, 2016
This comment has been minimized.
This comment has been minimized.
|
Ah, interesting to see. This might also render the old magazine mods useful again, as mod content. Or at least used in such a mod. |
BevapDin
reviewed
Feb 20, 2016
| } | ||
|
|
||
| Item_factory::~Item_factory() | ||
| { | ||
| item_options.clear(); |
This comment has been minimized.
This comment has been minimized.
BevapDin
Feb 20, 2016
Contributor
This should probably be in Item_factory::clear. The factory is only destroyed when the game is terminated, but clear is called before loading the game data.
Btw. why not make item_options a member or at least put it into an anonymous namespace/mark it as static?
This comment has been minimized.
This comment has been minimized.
BevapDin
reviewed
Feb 20, 2016
| // deleted before the guns are processed. | ||
| if( magazines_blacklisted ) { | ||
| for( std::map<std::string, itype *>::const_iterator a = m_templates.begin(); | ||
| a != m_templates.end(); ++a ) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mugling
reviewed
Feb 20, 2016
| } | ||
| itype *default_magazine = m_templates[ type->magazine_default.begin()->second ]; | ||
| type->gun->clip = default_magazine->magazine->capacity; | ||
| type->gun->reload_time = default_magazine->magazine->reload_time; |
This comment has been minimized.
This comment has been minimized.
mugling
Feb 20, 2016
Contributor
reload_time for magazines is per round so need to multiply by magazine capacity
This comment has been minimized.
This comment has been minimized.
Given you don't have to touch the reloading code to do this and we intend to continue supporting integral magazines in mainline this is an excellent solution.
The gunmod code is horrible and still has a lot of outstanding bugs. The required work to reimplement this isn't presently worth the outcome. |
This comment has been minimized.
This comment has been minimized.
Hmm. Understandable. If we are able to support the old magazine gunmods without additional hassle then it would be useful, but if it proves to complicate things, then it's fine to leave them dummied-out. |
kevingranade commentedFeb 20, 2016
Turns out this was pretty easy to do, so why not?
Reverts all guns to use integral magazines and blacklists all magazine items.
Integral magazine capacity is based on the default magazine for the gun.