diff options
Diffstat (limited to 'src/gamestate.cpp')
| -rw-r--r-- | src/gamestate.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gamestate.cpp b/src/gamestate.cpp index 4af49aa..dcae848 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp | |||
| @@ -428,8 +428,6 @@ void GameState::parse( const AstBranch::NodeList &lCode ) | |||
| 428 | Variable y = popDeref(); | 428 | Variable y = popDeref(); |
| 429 | Variable x = pop(); | 429 | Variable x = pop(); |
| 430 | deref( x ) += y; | 430 | deref( x ) += y; |
| 431 | // VariableRef r = x.getVariableRef(); | ||
| 432 | // setVariable( r.sName, getVariable( r.sName, r.sid ) + y, r.sid ); | ||
| 433 | } | 431 | } |
| 434 | break; | 432 | break; |
| 435 | 433 | ||
| @@ -438,8 +436,6 @@ void GameState::parse( const AstBranch::NodeList &lCode ) | |||
| 438 | Variable y = popDeref(); | 436 | Variable y = popDeref(); |
| 439 | Variable x = pop(); | 437 | Variable x = pop(); |
| 440 | deref( x ) -= y; | 438 | deref( x ) -= y; |
| 441 | // VariableRef r = x.getVariableRef(); | ||
| 442 | // setVariable( r.sName, getVariable( r.sName, r.sid ) - y, r.sid ); | ||
| 443 | } | 439 | } |
| 444 | break; | 440 | break; |
| 445 | 441 | ||
| @@ -618,6 +614,20 @@ void GameState::parse( const AstBranch::NodeList &lCode ) | |||
| 618 | parse( rDo ); | 614 | parse( rDo ); |
| 619 | } | 615 | } |
| 620 | } | 616 | } |
| 617 | else if( vIn.getType() == Variable::tList ) | ||
| 618 | { | ||
| 619 | if( bUseKey ) | ||
| 620 | { | ||
| 621 | throw Bu::ExceptionBase("You cannot use key:value pairs as iterators in a for each loop iterating over a list."); | ||
| 622 | } | ||
| 623 | const Variable::VariableList &rList = vIn.getList(); | ||
| 624 | for( Variable::VariableList::const_iterator i = | ||
| 625 | rList.begin(); i; i++ ) | ||
| 626 | { | ||
| 627 | setVariable( vrValue.sName, *i, vrValue.sid ); | ||
| 628 | parse( rDo ); | ||
| 629 | } | ||
| 630 | } | ||
| 621 | } | 631 | } |
| 622 | break; | 632 | break; |
| 623 | 633 | ||
