[colobot] 03/62: Update object variable when concatenating strings
Didier Raboud
odyx at moszumanska.debian.org
Fri Nov 10 11:53:53 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit 15b8cf7f782e94220f41b837208478051122e78a
Author: melex750 <melex750 at users.noreply.github.com>
Date: Thu May 25 02:09:44 2017 -0400
Update object variable when concatenating strings
---
src/CBot/CBotInstr/CBotTwoOpExpr.cpp | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/CBot/CBotInstr/CBotTwoOpExpr.cpp b/src/CBot/CBotInstr/CBotTwoOpExpr.cpp
index 4132103..54db597 100644
--- a/src/CBot/CBotInstr/CBotTwoOpExpr.cpp
+++ b/src/CBot/CBotInstr/CBotTwoOpExpr.cpp
@@ -405,9 +405,20 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
// creates a variable for the result
CBotVar* result = CBotVar::Create("", TypeRes);
+ // get left and right operands
+ CBotVar* left = pStk1->GetVar();
+ CBotVar* right = pStk2->GetVar();
+
// creates a variable to perform the calculation in the appropriate type
if ( TypeRes != CBotTypString ) // keep string conversion
+ {
TypeRes = std::max(type1.GetType(), type2.GetType());
+ }
+ else
+ {
+ left->Update(nullptr);
+ right->Update(nullptr);
+ }
if ( GetTokenType() == ID_ADD && type1.Eq(CBotTypString) )
{
@@ -422,8 +433,6 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
CBotError err = CBotNoErr;
// is a operation according to request
- CBotVar* left = pStk1->GetVar();
- CBotVar* right = pStk2->GetVar();
switch (GetTokenType())
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list