commit
1941020993
|
@ -22,6 +22,7 @@
|
||||||
#include "CBot/CBotInstr/CBotInstrUtils.h"
|
#include "CBot/CBotInstr/CBotInstrUtils.h"
|
||||||
#include "CBot/CBotInstr/CBotNew.h"
|
#include "CBot/CBotInstr/CBotNew.h"
|
||||||
#include "CBot/CBotInstr/CBotLeftExprVar.h"
|
#include "CBot/CBotInstr/CBotLeftExprVar.h"
|
||||||
|
#include "CBot/CBotInstr/CBotExprLitNull.h"
|
||||||
#include "CBot/CBotInstr/CBotTwoOpExpr.h"
|
#include "CBot/CBotInstr/CBotTwoOpExpr.h"
|
||||||
#include "CBot/CBotInstr/CBotFunction.h"
|
#include "CBot/CBotInstr/CBotFunction.h"
|
||||||
#include "CBot/CBotInstr/CBotExpression.h"
|
#include "CBot/CBotInstr/CBotExpression.h"
|
||||||
|
@ -722,6 +723,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
|
||||||
}
|
}
|
||||||
if ( !pStack->IsOk() ) return false;
|
if ( !pStack->IsOk() ) return false;
|
||||||
}
|
}
|
||||||
|
else if ( type2.Eq(CBotTypArrayPointer) ) i = new CBotExprLitNull();
|
||||||
|
|
||||||
|
|
||||||
if ( !bSecond )
|
if ( !bSecond )
|
||||||
|
@ -739,8 +741,15 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
|
||||||
if ( pv->IsStatic() && pv->m_InitExpr != nullptr )
|
if ( pv->IsStatic() && pv->m_InitExpr != nullptr )
|
||||||
{
|
{
|
||||||
CBotStack* pile = CBotStack::AllocateStack(); // independent stack
|
CBotStack* pile = CBotStack::AllocateStack(); // independent stack
|
||||||
|
if ( type2.Eq(CBotTypArrayPointer) )
|
||||||
|
{
|
||||||
|
while(pile->IsOk() && !pv->m_InitExpr->Execute(pile, pv));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
while(pile->IsOk() && !pv->m_InitExpr->Execute(pile)); // evaluates the expression without timer
|
while(pile->IsOk() && !pv->m_InitExpr->Execute(pile)); // evaluates the expression without timer
|
||||||
pv->SetVal( pile->GetVar() ) ;
|
pv->SetVal( pile->GetVar() ) ;
|
||||||
|
}
|
||||||
pile->Delete();
|
pile->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue