summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.cpp
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2021-11-26 00:51:47 +0100
committerAlexander Harkness <me@bearbin.net>2022-01-14 20:43:29 +0100
commit250b8eb652a57dcbdff4af7b6efb9c2554b45798 (patch)
tree1d8bf1aaeac6974d75c83524c8000161d8cc104c /src/UI/SlotArea.cpp
parentFix WriteXZYPosition64 and add tests (diff)
downloadcuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.gz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.bz2
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.lz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.xz
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.tar.zst
cuberite-250b8eb652a57dcbdff4af7b6efb9c2554b45798.zip
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r--src/UI/SlotArea.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index 0b060a5e4..bf328154d 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -399,7 +399,7 @@ bool cSlotArea::CollectItemsToHand(cItem & a_Dragging, cPlayer & a_Player, bool
{
continue;
}
- int ToMove = a_Dragging.GetMaxStackSize() - a_Dragging.m_ItemCount;
+ char ToMove = a_Dragging.GetMaxStackSize() - a_Dragging.m_ItemCount;
if (ToMove > SlotItem.m_ItemCount)
{
ToMove = SlotItem.m_ItemCount;
@@ -1167,7 +1167,7 @@ void cSlotAreaAnvil::UpdateResult(cPlayer & a_Player)
// Repair until out of materials, or fully repaired:
while ((DamageDiff > 0) && (NumItemsConsumed < Sacrifice.m_ItemCount))
{
- Output.m_ItemDamage -= DamageDiff;
+ Output.m_ItemDamage -= static_cast<char>(DamageDiff);
NeedExp += std::max(1, DamageDiff / 100) + static_cast<int>(Target.m_Enchantments.Count());
DamageDiff = std::min(static_cast<int>(Output.m_ItemDamage), static_cast<int>(Target.GetMaxDamage()) / 4);