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

Bayonet attached as gunmod to gun does not give increased damage, including for reach attacks (regression) #20214

Closed
keyspace opened this issue Feb 6, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@keyspace
Copy link
Contributor

commented Feb 6, 2017

Noticed on the forums.

Using latest git master (0.C-21030-gd8dd123670).

Current code has this in item::damage_melee() (line numbers are from a bisect I'm doing now, disregard):

2573     // consider any melee gunmods
2574     if( is_gun() ) {
2575         std::vector<int> opts = { res };
2576         for( const auto &e : gun_all_modes() ) {
2577             if( e.second.target != this && e.second.melee() ) {
2578                 opts.push_back( e.second.target->damage_melee( dt ) );
2579             }
2580         }
2581         return *std::max_element( opts.begin(), opts.end() );

It seems that the e.second.target != this check is always false, and nothing is pushed to opts.

So far checked 5c119f4 good, fc7b3ba bad.

EDIT: Bisected to 339e67d (PR #19515).


EDIT2: Possibly related: PR #18735, introduction of TOOLMOD.

I've been testing with:

  • makeshift_bayonet of type GENERIC (has gunmod_data defined),
  • sword_bayonet of type TOOL (has gunmod_data).

Guess should have also included:

  • pistol_bayonet of type GUNMOD (no gunmod_data).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.