Fix radar function parameter type detection, fixes #1298
parent
fb9fa49ce8
commit
a2df003b7e
|
@ -933,16 +933,13 @@ bool CScriptFunctions::rSearchAll(CBotVar* var, CBotVar* result, int& exception,
|
||||||
|
|
||||||
static CBotTypResult compileRadar(CBotVar* &var, void* user, CBotTypResult returnValue)
|
static CBotTypResult compileRadar(CBotVar* &var, void* user, CBotTypResult returnValue)
|
||||||
{
|
{
|
||||||
CBotVar* array;
|
|
||||||
|
|
||||||
if ( var == nullptr ) return returnValue;
|
if ( var == nullptr ) return returnValue;
|
||||||
if ( var->GetType() == CBotTypArrayPointer )
|
if ( var->GetType() == CBotTypArrayPointer )
|
||||||
{
|
{
|
||||||
array = var->GetItemList();
|
CBotTypResult type = var->GetTypResult().GetTypElem();
|
||||||
if ( array == nullptr ) return returnValue;
|
if ( type.GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadParam); //type
|
||||||
if ( array->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum); // type
|
|
||||||
}
|
}
|
||||||
else if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum); // type
|
else if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadParam); // type
|
||||||
var = var->GetNext();
|
var = var->GetNext();
|
||||||
if ( var == nullptr ) return returnValue;
|
if ( var == nullptr ) return returnValue;
|
||||||
if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum); // angle
|
if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum); // angle
|
||||||
|
|
Loading…
Reference in New Issue