Fixed potion removing in creative mode.
This commit is contained in:
parent
003206b1b0
commit
0fdb177208
|
@ -627,13 +627,11 @@ void cPlayer::FinishEating(void)
|
||||||
}
|
}
|
||||||
ItemHandler->OnFoodEaten(m_World, this, &Item);
|
ItemHandler->OnFoodEaten(m_World, this, &Item);
|
||||||
|
|
||||||
GetInventory().RemoveOneEquippedItem();
|
|
||||||
|
|
||||||
// if the food is mushroom soup, return a bowl to the inventory
|
// if the food is mushroom soup, return a bowl to the inventory
|
||||||
if (Item.m_ItemType == E_ITEM_MUSHROOM_SOUP)
|
if (Item.m_ItemType == E_ITEM_MUSHROOM_SOUP)
|
||||||
{
|
{
|
||||||
cItem EmptyBowl(E_ITEM_BOWL);
|
GetInventory().RemoveOneEquippedItem();
|
||||||
GetInventory().AddItem(EmptyBowl, true, true);
|
GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0);
|
a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -632,6 +632,7 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff
|
||||||
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
|
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
|
||||||
{
|
{
|
||||||
UNUSED(a_Item);
|
UNUSED(a_Item);
|
||||||
|
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||||
|
|
||||||
FoodInfo Info = GetFoodInfo();
|
FoodInfo Info = GetFoodInfo();
|
||||||
if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))
|
if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))
|
||||||
|
|
|
@ -21,8 +21,12 @@ public:
|
||||||
{
|
{
|
||||||
UNUSED(a_Item);
|
UNUSED(a_Item);
|
||||||
a_Player->ClearEntityEffects();
|
a_Player->ClearEntityEffects();
|
||||||
a_Player->GetInventory().RemoveOneEquippedItem();
|
|
||||||
a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
|
if (!a_Player->IsGameModeCreative())
|
||||||
|
{
|
||||||
|
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||||
|
a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -68,8 +68,12 @@ public:
|
||||||
cEntityEffect::GetPotionEffectDuration(PotionDamage),
|
cEntityEffect::GetPotionEffectDuration(PotionDamage),
|
||||||
cEntityEffect::GetPotionEffectIntensity(PotionDamage)
|
cEntityEffect::GetPotionEffectIntensity(PotionDamage)
|
||||||
);
|
);
|
||||||
a_Player->GetInventory().RemoveOneEquippedItem();
|
|
||||||
a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
|
if (!a_Player->IsGameModeCreative())
|
||||||
|
{
|
||||||
|
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||||
|
a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user