diff options
Diffstat (limited to 'src/CBot')
-rw-r--r-- | src/CBot/CBotStack.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp index 1679e5e..84472ac 100644 --- a/src/CBot/CBotStack.cpp +++ b/src/CBot/CBotStack.cpp @@ -787,8 +787,9 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end) while (p->m_next != NULL) { + if ( p->m_instr != NULL ) instr = p->m_instr; - if ( p->m_bFunc == 1 ) funct = p->m_instr; + if ( p->m_bFunc == 1 && p->m_instr != NULL ) funct = p->m_instr; if ( p->m_next->m_prog != prog ) break ; if (p->m_next2 && p->m_next2->m_state != 0) p = p->m_next2 ; @@ -807,7 +808,7 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end) t = instr->GetToken(); start = t->GetStart(); - end = t->GetEnd(); + end = t->GetEnd(); } CBotVar* CBotStack::GetStackVars(const char* &FunctionName, int level) |