mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Halt prematurely taking item requirements of duplicate type, fixes #1402
This commit is contained in:
parent
a53a8996f6
commit
bc7d6b0aae
@ -441,6 +441,7 @@ public class Quester {
|
||||
* @param q The quest to start
|
||||
* @param ignoreReqs Whether to ignore Requirements
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void takeQuest(final Quest q, final boolean ignoreReqs) {
|
||||
if (q == null) {
|
||||
return;
|
||||
@ -552,10 +553,13 @@ public class Quester {
|
||||
}
|
||||
if (player.isOnline()) {
|
||||
final Player p = getPlayer();
|
||||
final ItemStack[] original = p.getInventory().getContents().clone();
|
||||
for (final ItemStack is : reqs.getItems()) {
|
||||
if (reqs.getRemoveItems().get(reqs.getItems().indexOf(is)) == true) {
|
||||
if (InventoryUtil.removeItem(p.getInventory(), is) == false) {
|
||||
if (InventoryUtil.stripItem(p.getEquipment(), is) == false) {
|
||||
p.getInventory().setContents(original);
|
||||
p.updateInventory();
|
||||
p.sendMessage(Lang.get(p, "requirementsItemFail"));
|
||||
hardQuit(q);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user