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

Make skills check if equipped ammunition type is appropriate for equipped weapon #2660

Merged
merged 2 commits into from
Apr 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -15170,10 +15170,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