summaryrefslogtreecommitdiff
path: root/src/gamestate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gamestate.cpp')
-rw-r--r--src/gamestate.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/gamestate.cpp b/src/gamestate.cpp
index 57dbe2f..285c151 100644
--- a/src/gamestate.cpp
+++ b/src/gamestate.cpp
@@ -427,34 +427,28 @@ void GameState::parse( const AstBranch::NodeList &lCode )
427 case AstNode::tPlusStore: 427 case AstNode::tPlusStore:
428 { 428 {
429 Variable y = popDeref(); 429 Variable y = popDeref();
430 Variable x = pop(); 430 deref( lStack.peek(), true ) += y;
431 deref( x ) += y;
432 } 431 }
433 break; 432 break;
434 433
435 case AstNode::tMinusStore: 434 case AstNode::tMinusStore:
436 { 435 {
437 Variable y = popDeref(); 436 Variable y = popDeref();
438 Variable x = pop(); 437 deref( lStack.peek(), true ) -= y;
439 deref( x ) -= y;
440 } 438 }
441 break; 439 break;
442 440
443 case AstNode::tDivideStore: 441 case AstNode::tDivideStore:
444 { 442 {
445 Variable y = popDeref(); 443 Variable y = popDeref();
446 Variable x = pop(); 444 deref( lStack.peek(), true ) /= y;
447 VariableRef r = x.getVariableRef();
448 setVariable( r.sName, getVariable( r.sName, r.sid ) / y, r.sid );
449 } 445 }
450 break; 446 break;
451 447
452 case AstNode::tMultiplyStore: 448 case AstNode::tMultiplyStore:
453 { 449 {
454 Variable y = popDeref(); 450 Variable y = popDeref();
455 Variable x = pop(); 451 deref( lStack.peek(), true ) *= y;
456 VariableRef r = x.getVariableRef();
457 setVariable( r.sName, getVariable( r.sName, r.sid ) * y, r.sid );
458 } 452 }
459 break; 453 break;
460 454