Fixed commandline interpreter
parent
07a4d6a16b
commit
ef91fb8e9d
|
@ -559,24 +559,24 @@ void CBotStack::SetUserPtr(void* user)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool CBotStack::ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, const CBotTypResult& rettype)
|
bool CBotStack::ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, const CBotTypResult& rettype)
|
||||||
{
|
{
|
||||||
CBotTypResult res;
|
int res;
|
||||||
|
|
||||||
// first looks by the identifier
|
// first looks by the identifier
|
||||||
|
|
||||||
res = m_prog->GetExternalCalls()->DoCall(nullptr, nullptr, ppVar, this, rettype);
|
res = m_prog->GetExternalCalls()->DoCall(nullptr, nullptr, ppVar, this, rettype);
|
||||||
if (res.GetType() >= 0) return res.GetType();
|
if (res >= 0) return res;
|
||||||
|
|
||||||
res = m_prog->GetFunctions()->DoCall(nIdent, "", ppVar, this, token );
|
res = m_prog->GetFunctions()->DoCall(nIdent, "", ppVar, this, token );
|
||||||
if (res.GetType() >= 0) return res.GetType();
|
if (res >= 0) return res;
|
||||||
|
|
||||||
// if not found (recompile?) seeks by name
|
// if not found (recompile?) seeks by name
|
||||||
|
|
||||||
nIdent = 0;
|
nIdent = 0;
|
||||||
res = m_prog->GetExternalCalls()->DoCall(token, nullptr, ppVar, this, rettype);
|
res = m_prog->GetExternalCalls()->DoCall(token, nullptr, ppVar, this, rettype);
|
||||||
if (res.GetType() >= 0) return res.GetType();
|
if (res >= 0) return res;
|
||||||
|
|
||||||
res = m_prog->GetFunctions()->DoCall(nIdent, token->GetString(), ppVar, this, token );
|
res = m_prog->GetFunctions()->DoCall(nIdent, token->GetString(), ppVar, this, token );
|
||||||
if (res.GetType() >= 0) return res.GetType();
|
if (res >= 0) return res;
|
||||||
|
|
||||||
SetError(CBotErrUndefFunc, token);
|
SetError(CBotErrUndefFunc, token);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include "CBot/CBot.h"
|
#include "CBot/CBot.h"
|
||||||
|
|
||||||
|
using namespace CBot;
|
||||||
|
|
||||||
CBotTypResult cMessage(CBotVar* &var, void* user)
|
CBotTypResult cMessage(CBotVar* &var, void* user)
|
||||||
{
|
{
|
||||||
if ( var == nullptr ) return CBotTypResult(CBotErrLowParam);
|
if ( var == nullptr ) return CBotTypResult(CBotErrLowParam);
|
||||||
|
|
Loading…
Reference in New Issue