Fix dead people could be revived with a party hp potion

This commit is contained in:
Windyboy
2022-09-15 01:02:34 +08:00
parent ba558c350f
commit 388ee5c805

View File

@@ -1871,25 +1871,25 @@ public class Character extends AbstractCharacterObject {
} }
} }
public boolean applyConsumeOnPickup(final int itemid) { public boolean applyConsumeOnPickup(final int itemId) {
if (itemid / 1000000 == 2) { if (itemId / 1000000 == 2) {
if (ii.isConsumeOnPickup(itemid)) { if (ii.isConsumeOnPickup(itemId)) {
if (ItemConstants.isPartyItem(itemid)) { if (ItemConstants.isPartyItem(itemId)) {
List<Character> pchr = this.getPartyMembersOnSameMap(); List<Character> partyMembers = this.getPartyMembersOnSameMap();
if (!ItemId.isPartyAllCure(itemId)) {
if (!ItemId.isPartyAllCure(itemid)) { StatEffect mse = ii.getItemEffect(itemId);
StatEffect mse = ii.getItemEffect(itemid); if (!partyMembers.isEmpty()) {
for (Character mc : partyMembers) {
if (!pchr.isEmpty()) { if (mc.isAlive()) {
for (Character mc : pchr) { mse.applyTo(mc);
mse.applyTo(mc); }
} }
} else { } else if (this.isAlive()) {
mse.applyTo(this); mse.applyTo(this);
} }
} else { } else {
if (!pchr.isEmpty()) { if (!partyMembers.isEmpty()) {
for (Character mc : pchr) { for (Character mc : partyMembers) {
mc.dispelDebuffs(); mc.dispelDebuffs();
} }
} else { } else {
@@ -1897,11 +1897,11 @@ public class Character extends AbstractCharacterObject {
} }
} }
} else { } else {
ii.getItemEffect(itemid).applyTo(this); ii.getItemEffect(itemId).applyTo(this);
} }
if (itemid / 10000 == 238) { if (itemId / 10000 == 238) {
this.getMonsterBook().addCard(client, itemid); this.getMonsterBook().addCard(client, itemId);
} }
return true; return true;
} }