v2.0.0: fixed cursed items being non-removable when in lost invent

This commit is contained in:
Evan Debenham
2023-01-06 16:11:34 -05:00
parent 7d6d9e9f0e
commit 4a3228533a

View File

@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
@@ -116,7 +117,9 @@ public abstract class EquipableItem extends Item {
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
if (cursed && hero.buff(MagicImmune.class) == null) {
if (cursed
&& hero.buff(MagicImmune.class) == null
&& (hero.buff(LostInventory.class) == null || keptThoughLostInvent)) {
GLog.w(Messages.get(EquipableItem.class, "unequip_cursed"));
return false;
}