Browse Source

Ensure the character cache is populated before accessing it

master
Christopher 9 years ago
parent
commit
ece7d26f52
  1. 5
      Assets/Fungus/Narrative/Scripts/ConversationManager.cs

5
Assets/Fungus/Narrative/Scripts/ConversationManager.cs

@ -217,6 +217,11 @@ namespace Fungus
// try to find the character param first, since we need to get its portrait // try to find the character param first, since we need to get its portrait
int characterIndex = -1; int characterIndex = -1;
if (characters == null)
{
PopulateCharacterCache();
}
for (int i = 0; item.Character == null && i < sayParams.Length; i++) for (int i = 0; item.Character == null && i < sayParams.Length; i++)
{ {
for (int j = 0; j < characters.Length; j++) for (int j = 0; j < characters.Length; j++)

Loading…
Cancel
Save