fix: potential division by zero
This commit is contained in:
parent
4fb46bd6ec
commit
bb2e93a539
2 changed files with 1 additions and 10 deletions
|
|
@ -398,7 +398,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int getHighestDamageForTeam (int team) const {
|
int getHighestDamageForTeam (int team) const {
|
||||||
return m_highestDamage[team];
|
return cr::max (1, m_highestDamage[team]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setHighestDamageForTeam (int team, int value) {
|
void setHighestDamageForTeam (int team, int value) {
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,6 @@ void BotGraph::reset () {
|
||||||
m_hasChanged = false;
|
m_hasChanged = false;
|
||||||
m_narrowChecked = false;
|
m_narrowChecked = false;
|
||||||
|
|
||||||
// reset highest recorded damage
|
|
||||||
for (int team = Team::Terrorist; team < kGameTeamNum; ++team) {
|
|
||||||
m_highestDamage[team] = 1;
|
|
||||||
}
|
|
||||||
m_graphAuthor.clear ();
|
m_graphAuthor.clear ();
|
||||||
m_graphModified.clear ();
|
m_graphModified.clear ();
|
||||||
}
|
}
|
||||||
|
|
@ -1266,11 +1262,6 @@ void BotGraph::loadPractice () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset highest recorded damage
|
|
||||||
for (int team = Team::Terrorist; team < kGameTeamNum; ++team) {
|
|
||||||
m_highestDamage[team] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dataLoaded = loadStorage <Practice> ("Practice", StorageOption::Practice, StorageVersion::Practice, m_practice, nullptr, nullptr);
|
bool dataLoaded = loadStorage <Practice> ("Practice", StorageOption::Practice, StorageVersion::Practice, m_practice, nullptr, nullptr);
|
||||||
int count = length ();
|
int count = length ();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue