diff --git a/crogine/src/core/App.cpp b/crogine/src/core/App.cpp index 8b603ee8d..b1cab218f 100644 --- a/crogine/src/core/App.cpp +++ b/crogine/src/core/App.cpp @@ -68,7 +68,7 @@ void winAbort(int) #include #ifdef CRO_DEBUG_ -#define DEBUG_NO_CONTROLLER +//#define DEBUG_NO_CONTROLLER #endif // CRO_DEBUG_ using namespace cro; diff --git a/libsocial/include/Social.hpp b/libsocial/include/Social.hpp index a99496e24..99bec377a 100644 --- a/libsocial/include/Social.hpp +++ b/libsocial/include/Social.hpp @@ -45,7 +45,7 @@ source distribution. //(terrain vertex data and materials changed 1100 -> 1110) //(player avatar data format changed 1110 -> 1120) static constexpr std::uint16_t CURRENT_VER = 1120; -static const std::string StringVer("1.12.0"); +static const std::string StringVer("1.12.1"); class Social final diff --git a/samples/golf/src/golf/MenuAvatars.cpp b/samples/golf/src/golf/MenuAvatars.cpp index 6a69157e8..7f0c7ab10 100644 --- a/samples/golf/src/golf/MenuAvatars.cpp +++ b/samples/golf/src/golf/MenuAvatars.cpp @@ -1613,6 +1613,14 @@ void MenuState::eraseCurrentProfile() { auto profileID = m_profileData.playerProfiles[m_profileData.activeProfileIndex].profileID; + //assign a valid texture to the preview model + auto idx = indexFromAvatarID(m_profileData.playerProfiles[m_profileData.activeProfileIndex].skinID); + m_playerAvatars[idx].previewModel.getComponent().setMaterialProperty(0, "u_diffuseMap", m_playerAvatars[idx].getTextureID()); + + //before we delete the old one... + m_profileTextures.erase(m_profileTextures.begin() + m_profileData.activeProfileIndex); + + //erase profile first so we know we have valid remaining m_profileData.playerProfiles.erase(m_profileData.playerProfiles.begin() + m_profileData.activeProfileIndex); @@ -1627,7 +1635,6 @@ void MenuState::eraseCurrentProfile() } } - m_profileTextures.erase(m_profileTextures.begin() + m_profileData.activeProfileIndex); m_profileData.activeProfileIndex = m_rosterMenu.profileIndices[m_rosterMenu.activeIndex]; //refresh the preview / roster list diff --git a/samples/golf/src/golf/MenuCustomisation.cpp b/samples/golf/src/golf/MenuCustomisation.cpp index 52a252718..1d55e5ec5 100644 --- a/samples/golf/src/golf/MenuCustomisation.cpp +++ b/samples/golf/src/golf/MenuCustomisation.cpp @@ -450,7 +450,7 @@ void MenuState::updateProfileTextures(std::size_t start, std::size_t count) return; } - CRO_ASSERT(start < count && count <= m_profileData.playerProfiles.size(), ""); + CRO_ASSERT(start < m_profileData.playerProfiles.size() && start + count <= m_profileData.playerProfiles.size(), ""); for (auto i = start; i < start + count; ++i) { diff --git a/samples/golf/src/golf/ProfileState.cpp b/samples/golf/src/golf/ProfileState.cpp index 7d22db963..b7f1760c6 100644 --- a/samples/golf/src/golf/ProfileState.cpp +++ b/samples/golf/src/golf/ProfileState.cpp @@ -503,7 +503,7 @@ void ProfileState::buildScene() //refresh the avatar settings setAvatarIndex(indexFromAvatarID(m_activeProfile.skinID)); setHairIndex(indexFromHairID(m_activeProfile.hairID)); - setBallIndex(indexFromBallID(m_activeProfile.ballID)); + setBallIndex(indexFromBallID(m_activeProfile.ballID) % m_ballModels.size()); refreshMugshot(); refreshNameString(); refreshSwatch(); @@ -1656,6 +1656,8 @@ void ProfileState::setHairIndex(std::size_t idx) void ProfileState::setBallIndex(std::size_t idx) { + CRO_ASSERT(idx < m_ballModels.size(), ""); + if (m_ballHairModels[m_ballHairIndex].isValid()) { m_ballModels[m_ballIndex].root.getComponent().removeChild(m_ballHairModels[m_ballHairIndex].getComponent());