This commit is contained in:
Tiger Wang 2022-01-14 18:21:10 +00:00 committed by Alexander Harkness
parent 903bcfc61f
commit da0fdbe113
10 changed files with 12 additions and 12 deletions

View File

@ -2344,7 +2344,7 @@ void cPlayer::SendBlocksAround(int a_BlockX, int a_BlockY, int a_BlockZ, int a_R
{ {
for (int x = a_BlockX - a_Range + 1; x < a_BlockX + a_Range; x++) for (int x = a_BlockX - a_Range + 1; x < a_BlockX + a_Range; x++)
{ {
blks.emplace_back(x, y, z, E_BLOCK_AIR, NIBBLETYPE(0)); // Use fake blocktype, it will get set later on. blks.emplace_back(x, y, z, E_BLOCK_AIR, static_cast<NIBBLETYPE>(0)); // Use fake blocktype, it will get set later on.
} }
} }
} // for y } // for y

View File

@ -359,7 +359,7 @@ void cLightingThread::PrepareSkyLight(void)
// Fill the top of the chunk with all-light: // Fill the top of the chunk with all-light:
if (m_MaxHeight < cChunkDef::Height - 1) if (m_MaxHeight < cChunkDef::Height - 1)
{ {
std::fill(m_SkyLight + (m_MaxHeight + 1) * BlocksPerYLayer, m_SkyLight + ARRAYCOUNT(m_SkyLight), NIBBLETYPE(15)); std::fill(m_SkyLight + (m_MaxHeight + 1) * BlocksPerYLayer, m_SkyLight + ARRAYCOUNT(m_SkyLight), static_cast<NIBBLETYPE>(15));
} }
// Walk every column that has all XZ neighbors // Walk every column that has all XZ neighbors

View File

@ -40,7 +40,7 @@ void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{ {
cItems Drops; cItems Drops;
m_EggDropTimer = 0; m_EggDropTimer = 0;
Drops.emplace_back(E_ITEM_EGG, char(1)); Drops.emplace_back(E_ITEM_EGG, static_cast<char>(1));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
} }
else else

View File

@ -1511,7 +1511,7 @@ 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) 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 Count = GetRandomProvider().RandInt(a_Min, a_Max);
char MaxStackSize = cItem(a_Item).GetMaxStackSize(); auto MaxStackSize = static_cast<unsigned int>(cItem(a_Item).GetMaxStackSize());
while (Count > MaxStackSize) while (Count > MaxStackSize)
{ {
a_Drops.emplace_back(a_Item, MaxStackSize, a_ItemHealth); 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)) if (GetRandomProvider().RandBool(a_Chance / 100.0))
{ {
a_Drops.emplace_back(a_Item, char(1), a_ItemHealth); a_Drops.emplace_back(a_Item, static_cast<char>(1), a_ItemHealth);
} }
} }

View File

@ -65,7 +65,7 @@ void cMooshroom::OnRightClicked(cPlayer & a_Player)
} }
cItems Drops; cItems Drops;
Drops.emplace_back(E_BLOCK_RED_MUSHROOM, char(5), char(0)); Drops.emplace_back(E_BLOCK_RED_MUSHROOM, static_cast<char>(5), static_cast<char>(0));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
m_World->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtCow, false); m_World->SpawnMob(GetPosX(), GetPosY(), GetPosZ(), mtCow, false);
Destroy(); Destroy();

View File

@ -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); AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP);
if (m_bIsSaddled) if (m_bIsSaddled)
{ {
a_Drops.emplace_back(E_ITEM_SADDLE, char(1)); a_Drops.emplace_back(E_ITEM_SADDLE, static_cast<char>(1));
} }
} }

View File

@ -42,7 +42,7 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
if (!m_IsSheared) if (!m_IsSheared)
{ {
a_Drops.emplace_back(E_BLOCK_WOOL, char(1), static_cast<short>(m_WoolColor)); a_Drops.emplace_back(E_BLOCK_WOOL, static_cast<char>(1), static_cast<short>(m_WoolColor));
} }
unsigned int LootingLevel = 0; unsigned int LootingLevel = 0;

View File

@ -114,7 +114,7 @@ void cIsThread::SetThreadName() const
#pragma pack(pop) #pragma pack(pop)
const DWORD NAME_EXCEPTION = 0x406D1388; const DWORD NAME_EXCEPTION = 0x406D1388;
const THREADNAME_INFO Name = { 0x1000, m_ThreadName.c_str(), DWORD(-1), 0 }; const THREADNAME_INFO Name = { 0x1000, m_ThreadName.c_str(), static_cast<DWORD>(-1), 0 };
__try __try
{ {

View File

@ -513,7 +513,7 @@ void cProtocol_1_8_0::SendEntityAnimation(const cEntity & a_Entity, const Entity
return; return;
} }
if (const auto AnimationID = GetProtocolEntityAnimation(a_Animation); AnimationID != unsigned char(-1)) if (const auto AnimationID = GetProtocolEntityAnimation(a_Animation); AnimationID != static_cast<unsigned char>(-1))
{ {
cPacketizer Pkt(*this, pktEntityAnimation); cPacketizer Pkt(*this, pktEntityAnimation);
Pkt.WriteVarInt32(a_Entity.GetUniqueID()); Pkt.WriteVarInt32(a_Entity.GetUniqueID());
@ -1978,7 +1978,7 @@ unsigned char cProtocol_1_8_0::GetProtocolEntityAnimation(const EntityAnimation
case EntityAnimation::PlayerLeavesBed: return 2; case EntityAnimation::PlayerLeavesBed: return 2;
case EntityAnimation::PlayerMainHandSwings: return 0; case EntityAnimation::PlayerMainHandSwings: return 0;
case EntityAnimation::PlayerOffHandSwings: return 0; case EntityAnimation::PlayerOffHandSwings: return 0;
default: return unsigned char(-1); default: return static_cast<unsigned char>(-1);
} }
} }

View File

@ -23,7 +23,7 @@ namespace RedstoneRepeaterHandler
if (!Chunk.UnboundedRelGetBlock(a_Position, Type, Meta)) if (!Chunk.UnboundedRelGetBlock(a_Position, Type, Meta))
{ {
return std::make_pair(false, NIBBLETYPE(0)); return std::make_pair(false, static_cast<NIBBLETYPE>(0));
} }
return std::make_pair(IsOn(Type), Meta); return std::make_pair(IsOn(Type), Meta);