From 4321e32251c82a9ba70b2aee90b8d1846f743dfe Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 26 Oct 2003 08:24:46 +0000 Subject: [PATCH] Make this more tolerant: it's too easy to not cache a skin, especially in the editor and how to play. --- stepmania/src/NoteField.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index ec2c0b5e4d..9d6fbb0df9 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -124,8 +124,12 @@ void NoteField::RefreshBeatToNoteSkin() const CString &Skin = it->second; map::iterator display = m_NoteDisplays.find( Skin ); + if( display == m_NoteDisplays.end() ) + { + this->CacheNoteSkin( Skin ); + display = m_NoteDisplays.find( Skin ); + } - /* If this happens, we tried to use a note skin that wasn't pre-cached. */ RAGE_ASSERT_M( display != m_NoteDisplays.end(), ssprintf("Couldn't find %s", Skin.c_str()) ); NoteDisplayCols *cols = display->second;