commit e95187f534b20d9d6d10d2fe526fb434fd3382b8
parent f8db61747d205b740579e20c0a7f7a587ba1541a
Author: Adam Malone <1319733+freddyz@users.noreply.github.com>
Date: Thu, 3 Jan 2019 10:52:42 -0600
handle zero in LaundrySoupSequence
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dtpulse.cpp b/src/dtpulse.cpp
@@ -988,15 +988,15 @@ std::vector<Token> Parser::atExpandTokens(std::vector<std::vector<Token>> tokenV
}
else if(thisToken.type =="Digit" || thisToken.type=="Integer" || thisToken.type=="ChanceOfInteger") {
newType = thisToken.type;
- thisLength = std::stoi(thisToken.value);
+ thisLength = thisToken.duration;
}
if((atNum - sum) < thisLength) {
thisLength = (atNum-sum);
}
-
+ thisVal = (thisToken.value=="0") ? "0" :std::to_string(static_cast<long long>(thisLength));
sum += thisLength;
- output.push_back(Token(newType,std::to_string(static_cast<long long>(thisLength)),-1,thisLength));
+ output.push_back(Token(newType,thisVal,-1,thisLength));
innerDex++;
}
}