Просмотр исходного кода

Bugfix: Fixing exceptions in managed code caused by array of enums using the wrong underlying type

BearishSun 8 лет назад
Родитель
Сommit
8124111b5f
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      Source/SBansheeEditor/Wrappers/BsScriptCodeEditor.cpp

+ 5 - 2
Source/SBansheeEditor/Wrappers/BsScriptCodeEditor.cpp

@@ -40,10 +40,13 @@ namespace bs
 	{
 	{
 		Vector<CodeEditorType> availableEditors = CodeEditorManager::instance().getAvailableEditors();
 		Vector<CodeEditorType> availableEditors = CodeEditorManager::instance().getAvailableEditors();
 
 
-		ScriptArray outArray = ScriptArray::create<UINT32>((UINT32)availableEditors.size());
+		ScriptArray outArray = ScriptArray::create<INT32>((UINT32)availableEditors.size());
 		UINT32 idx = 0;
 		UINT32 idx = 0;
 		for (auto& entry : availableEditors)
 		for (auto& entry : availableEditors)
-			outArray.set(idx, (UINT32)entry);
+		{
+			outArray.set(idx, (INT32)entry);
+			idx++;
+		}
 
 
 		return outArray.getInternal();
 		return outArray.getInternal();
 	}
 	}