Skip to content

Commit

Permalink
Merge pull request #2660 from Kenpachi2k13/skill_check_ammo_type
Browse files Browse the repository at this point in the history
Make skills check if equipped ammunition type is appropriate for equipped weapon
  • Loading branch information
MishimaHaruna authored Apr 5, 2020
2 parents a9709a1 + f9d41ba commit 02a84aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions db/re/skill_db.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16043,6 +16043,7 @@ skill_db: (
}
AmmoTypes: {
A_BULLET: true
A_GRENADE: true
}
AmmoAmount: 5
}
Expand Down
6 changes: 2 additions & 4 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -15172,10 +15172,8 @@ static int skill_check_condition_castend(struct map_session_data *sd, uint16 ski
clif->messagecolor_self(sd->fd, COLOR_RED, e_msg);
return 0;
}
if (!(require.ammo&1<<sd->inventory_data[i]->subtype)) { //Ammo type check. Send the "wrong weapon type" message
//which is the closest we have to wrong ammo type. [Skotlex]
clif->arrow_fail(sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex]
//clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0, 0);
if ((require.ammo & (1 << sd->inventory_data[i]->subtype)) == 0 || !battle->check_arrows(sd)) { // Ammo type check.
clif->arrow_fail(sd, 0); // "Please equip the proper ammunition first."
return 0;
}
}
Expand Down

0 comments on commit 02a84aa

Please sign in to comment.