From 72b4228abe583cd953491575cf42bae17ff5e9d2 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 7 Oct 2014 22:28:32 +0200 Subject: Fixed CBot debugger (#325) --- src/CBot/CBotStack.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/CBot') 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) -- cgit v1.2.3-1-g7c22