summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-02-07 22:13:15 -0700
committerMike Buland <eichlan@xagasoft.com>2012-02-07 22:13:15 -0700
commite9170376ec9d75f65949ac6b61694ddf7ad37897 (patch)
treef87184d95d3436f7f2e64d749a50e2ce82a6e7b3 /src
parent0b7d87e4a32bd443605a1b467293017b7bfcc0ca (diff)
downloadstage-e9170376ec9d75f65949ac6b61694ddf7ad37897.tar.gz
stage-e9170376ec9d75f65949ac6b61694ddf7ad37897.tar.bz2
stage-e9170376ec9d75f65949ac6b61694ddf7ad37897.tar.xz
stage-e9170376ec9d75f65949ac6b61694ddf7ad37897.zip
Goto is broken.
I think I need to switch to a global instruction stack, it'll be so much easier to manage.
Diffstat (limited to 'src')
-rw-r--r--src/gamebuilder.cpp2
-rw-r--r--src/gamestate.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gamebuilder.cpp b/src/gamebuilder.cpp
index e8ecf63..ac1174a 100644
--- a/src/gamebuilder.cpp
+++ b/src/gamebuilder.cpp
@@ -123,7 +123,7 @@ void GameBuilder::beginSituationMode( Situation::Mode m )
123 123
124void GameBuilder::closeSituationMode() 124void GameBuilder::closeSituationMode()
125{ 125{
126// sio << "Set situation <<" << pCurSit->getName() << ">> mode " << eCurSitMode << " to " << *pCurRoot << sio.nl; 126 sio << "Set situation <<" << pCurSit->getName() << ">> mode " << eCurSitMode << " to " << *pCurRoot << sio.nl;
127 pCurSit->setAst( pCurRoot, eCurSitMode ); 127 pCurSit->setAst( pCurRoot, eCurSitMode );
128 pCurRoot = pCurNode = NULL; 128 pCurRoot = pCurNode = NULL;
129} 129}
diff --git a/src/gamestate.cpp b/src/gamestate.cpp
index 041af86..99cc749 100644
--- a/src/gamestate.cpp
+++ b/src/gamestate.cpp
@@ -520,8 +520,8 @@ void GameState::parse( const AstBranch::NodeList &lCode )
520 bEscape = false; 520 bEscape = false;
521 for( AstBranch::NodeList::const_iterator i = lCode.begin(); i; i++ ) 521 for( AstBranch::NodeList::const_iterator i = lCode.begin(); i; i++ )
522 { 522 {
523 // sio << "Stack: " << lStack << sio.nl; 523 sio << "Stack: " << lStack << sio.nl;
524 // sio << "exec: " << (*i)->getType() << sio.nl; 524 sio << "exec: " << (*i)->getType() << sio.nl;
525 switch( (*i)->getType() ) 525 switch( (*i)->getType() )
526 { 526 {
527 // tLeaf 527 // tLeaf
@@ -705,6 +705,8 @@ void GameState::parse( const AstBranch::NodeList &lCode )
705 throw Bu::ExceptionBase("You cannot goto anything but a situation."); 705 throw Bu::ExceptionBase("You cannot goto anything but a situation.");
706 gotoSituation( x.getString() ); 706 gotoSituation( x.getString() );
707 bEscape = true; 707 bEscape = true;
708 sio << "Initial return" << sio.nl;
709 push( Variable( Variable::tNull ) );
708 return; 710 return;
709 } 711 }
710 break; 712 break;
@@ -908,6 +910,7 @@ void GameState::parse( const AstBranch::NodeList &lCode )
908 910
909 if( bEscape || !bRunning ) 911 if( bEscape || !bRunning )
910 { 912 {
913 sio << "Returning from" << sio.nl;
911 return; 914 return;
912 } 915 }
913 } 916 }