From 677ed1ce9af1e6a2708e2443850cc7985130837f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 20 May 2020 12:19:00 -0400 Subject: [PATCH] CScriptSpawnPoint: Resolve sign conversion warnings operator[] takes a size_t, not an int. --- Runtime/World/CScriptSpawnPoint.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Runtime/World/CScriptSpawnPoint.cpp b/Runtime/World/CScriptSpawnPoint.cpp index 7b22469a9..645081504 100644 --- a/Runtime/World/CScriptSpawnPoint.cpp +++ b/Runtime/World/CScriptSpawnPoint.cpp @@ -15,18 +15,18 @@ CScriptSpawnPoint::CScriptSpawnPoint(TUniqueId uid, std::string_view name, const bool defaultSpawn, bool active, bool morphed) : CEntity(uid, info, active, name), x34_xf(xf), x64_itemCounts(itemCounts) { #ifndef NDEBUG - x64_itemCounts[int(CPlayerState::EItemType::MorphBall)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::MorphBallBombs)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::PhazonSuit)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::ThermalVisor)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::XRayVisor)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::GrappleBeam)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::BoostBall)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::ChargeBeam)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::PowerBombs)] = 8; - x64_itemCounts[int(CPlayerState::EItemType::SpaceJumpBoots)] = 1; - x64_itemCounts[int(CPlayerState::EItemType::Missiles)] = - std::max(x64_itemCounts[int(CPlayerState::EItemType::Missiles)], u32(5)); + x64_itemCounts[size_t(CPlayerState::EItemType::MorphBall)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::MorphBallBombs)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::PhazonSuit)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::ThermalVisor)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::XRayVisor)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::GrappleBeam)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::BoostBall)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::ChargeBeam)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::PowerBombs)] = 8; + x64_itemCounts[size_t(CPlayerState::EItemType::SpaceJumpBoots)] = 1; + x64_itemCounts[size_t(CPlayerState::EItemType::Missiles)] = + std::max(x64_itemCounts[size_t(CPlayerState::EItemType::Missiles)], u32(5)); #endif x10c_24_firstSpawn = defaultSpawn; x10c_25_morphed = morphed; @@ -77,8 +77,8 @@ void CScriptSpawnPoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objI } u32 CScriptSpawnPoint::GetPowerup(CPlayerState::EItemType item) const { - const auto idx = static_cast(item); - if (item >= CPlayerState::EItemType::Max || idx < 0) { + const auto idx = static_cast(item); + if (item >= CPlayerState::EItemType::Max) { return x64_itemCounts.front(); } return x64_itemCounts[idx];