summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-04-05 20:54:08 +0200
committerGitHub <noreply@github.com>2020-04-05 20:54:08 +0200
commit02a84aa9870422bddb7b631dd09bb45c1e5e6856 (patch)
treeb7a0d66d131055b2f728a2a9b794e558fb2e7d63
parenta9709a1346a36861195b3b429de60944c57055d4 (diff)
parentf9d41bae5863671995f5be590b8efa3a5f8af94b (diff)
downloadhercules-02a84aa9870422bddb7b631dd09bb45c1e5e6856.tar.gz
hercules-02a84aa9870422bddb7b631dd09bb45c1e5e6856.tar.bz2
hercules-02a84aa9870422bddb7b631dd09bb45c1e5e6856.tar.xz
hercules-02a84aa9870422bddb7b631dd09bb45c1e5e6856.zip
Merge pull request #2660 from Kenpachi2k13/skill_check_ammo_type
Make skills check if equipped ammunition type is appropriate for equipped weapon
-rw-r--r--db/re/skill_db.conf1
-rw-r--r--src/map/skill.c6
2 files changed, 3 insertions, 4 deletions
diff --git a/db/re/skill_db.conf b/db/re/skill_db.conf
index 376fba179..8cb55d918 100644
--- a/db/re/skill_db.conf
+++ b/db/re/skill_db.conf
@@ -16043,6 +16043,7 @@ skill_db: (
}
AmmoTypes: {
A_BULLET: true
+ A_GRENADE: true
}
AmmoAmount: 5
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 39f0bcfe1..176ce7b58 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -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;
}
}