From 250b8eb652a57dcbdff4af7b6efb9c2554b45798 Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Fri, 26 Nov 2021 00:51:47 +0100 Subject: Fixed Compiler Warnings --- src/Mobs/Chicken.cpp | 2 +- src/Mobs/Monster.cpp | 6 +++--- src/Mobs/Mooshroom.cpp | 2 +- src/Mobs/Pig.cpp | 2 +- src/Mobs/Sheep.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp index 1a6d62fce..bb0a4efbf 100644 --- a/src/Mobs/Chicken.cpp +++ b/src/Mobs/Chicken.cpp @@ -40,7 +40,7 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { cItems Drops; m_EggDropTimer = 0; - Drops.emplace_back(E_ITEM_EGG, 1); + Drops.emplace_back(E_ITEM_EGG, char(1)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } else diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 3193f97ae..0ebf30554 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -1510,8 +1510,8 @@ void cMonster::RightClickFeed(cPlayer & a_Player) void cMonster::AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth) { - auto Count = GetRandomProvider().RandInt(a_Min, a_Max); - auto MaxStackSize = static_cast(cItem(a_Item).GetMaxStackSize()); + auto Count = GetRandomProvider().RandInt(a_Min, a_Max); + char MaxStackSize = ItemHandler(a_Item)->GetMaxStackSize(); while (Count > MaxStackSize) { a_Drops.emplace_back(a_Item, MaxStackSize, a_ItemHealth); @@ -1531,7 +1531,7 @@ void cMonster::AddRandomUncommonDropItem(cItems & a_Drops, float a_Chance, short { if (GetRandomProvider().RandBool(a_Chance / 100.0)) { - a_Drops.emplace_back(a_Item, 1, a_ItemHealth); + a_Drops.emplace_back(a_Item, char(1), a_ItemHealth); } } diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp index 1e0d13c9b..3e4cb7154 100644 --- a/src/Mobs/Mooshroom.cpp +++ b/src/Mobs/Mooshroom.cpp @@ -65,7 +65,7 @@ void cMooshroom::OnRightClicked(cPlayer & a_Player) } cItems Drops; - Drops.emplace_back(E_BLOCK_RED_MUSHROOM, 5, 0); + Drops.emplace_back(E_BLOCK_RED_MUSHROOM, char(5), char(0)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); m_World->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtCow, false); Destroy(); diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp index 88f3795c1..dc26caca9 100644 --- a/src/Mobs/Pig.cpp +++ b/src/Mobs/Pig.cpp @@ -34,7 +34,7 @@ void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer) AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP); if (m_bIsSaddled) { - a_Drops.emplace_back(E_ITEM_SADDLE, 1); + a_Drops.emplace_back(E_ITEM_SADDLE, char(1)); } } diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp index 156046c74..14d8dd8d8 100644 --- a/src/Mobs/Sheep.cpp +++ b/src/Mobs/Sheep.cpp @@ -42,7 +42,7 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer) if (!m_IsSheared) { - a_Drops.emplace_back(E_BLOCK_WOOL, 1, static_cast(m_WoolColor)); + a_Drops.emplace_back(E_BLOCK_WOOL, char(1), static_cast(m_WoolColor)); } unsigned int LootingLevel = 0; -- cgit v1.2.3