Fixes Duration1 and Duration2 negative values

* Duration1 and Duration2 have potential -1 value to send infinite tick for statuses.
Thanks to @teededung!
This commit is contained in:
aleos
2020-02-09 11:54:19 -05:00
parent 47131b4585
commit e4046f9d18
3 changed files with 51 additions and 4 deletions

View File

@@ -1894,14 +1894,14 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current) {
}
if (!isMultiLevel(it_cast->second.upkeep_time)) {
if (it_cast->second.upkeep_time[0] > 0)
if (it_cast->second.upkeep_time[0] != 0)
body << YAML::Key << "Duration1" << YAML::Value << it_cast->second.upkeep_time[0];
} else {
body << YAML::Key << "Duration1";
body << YAML::BeginSeq;
for (size_t i = 0; i < ARRAYLENGTH(it_cast->second.upkeep_time); i++) {
if (it_cast->second.upkeep_time[i] > 0) {
if (it_cast->second.upkeep_time[i] != 0) {
body << YAML::BeginMap;
body << YAML::Key << "Level" << YAML::Value << i + 1;
body << YAML::Key << "Time" << YAML::Value << it_cast->second.upkeep_time[i];
@@ -1913,14 +1913,14 @@ static bool skill_parse_row_skilldb(char* split[], int columns, int current) {
}
if (!isMultiLevel(it_cast->second.upkeep_time2)) {
if (it_cast->second.upkeep_time2[0] > 0)
if (it_cast->second.upkeep_time2[0] != 0)
body << YAML::Key << "Duration2" << YAML::Value << it_cast->second.upkeep_time2[0];
} else {
body << YAML::Key << "Duration2";
body << YAML::BeginSeq;
for (size_t i = 0; i < ARRAYLENGTH(it_cast->second.upkeep_time2); i++) {
if (it_cast->second.upkeep_time2[i] > 0) {
if (it_cast->second.upkeep_time2[i] != 0) {
body << YAML::BeginMap;
body << YAML::Key << "Level" << YAML::Value << i + 1;
body << YAML::Key << "Time" << YAML::Value << it_cast->second.upkeep_time2[i];