Browse Source

Fixed AngelScript assert/crash if void value is attempted to be cast explicitly. Closes #33.

Lasse Öörni 12 years ago
parent
commit
bdd2d03c81
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/ThirdParty/AngelScript/source/as_compiler.cpp

+ 2 - 1
Source/ThirdParty/AngelScript/source/as_compiler.cpp

@@ -8148,7 +8148,8 @@ void asCCompiler::CompileConversion(asCScriptNode *node, asSExprContext *ctx)
 	// here we'll only treat those conversions that require an explicit cast.
 	// here we'll only treat those conversions that require an explicit cast.
 
 
 	bool conversionOK = false;
 	bool conversionOK = false;
-	if( !expr.type.isConstant )
+	// Urho3D: check for void before attempting to compile the cast
+	if( !expr.type.isConstant && expr.type.dataType.GetTokenType() != ttVoid )
 	{
 	{
 		if( !expr.type.dataType.IsObject() )
 		if( !expr.type.dataType.IsObject() )
 			ConvertToTempVariable(&expr);
 			ConvertToTempVariable(&expr);