Asan: correct some undefined, ... problems

This commit is contained in:
Laurent Alonso(fr)
2020-05-16 15:15:38 +02:00
committed by Celtic Minstrel
parent b6c5552ac0
commit 9f802b3fcf
8 changed files with 27 additions and 8 deletions

View File

@@ -20,6 +20,8 @@ const short cCreature::charm_odds[21] = {90,90,85,80,78, 75,73,60,40,30, 20,10,4
cCreature::cCreature() {
attitude = eAttitude::DOCILE;
cur_loc.x = cur_loc.y = targ_loc.x = targ_loc.y = 80;
// ASAN party_summoned writed but unset
party_summoned = false;
}
cCreature::cCreature(int num) : cCreature() {

View File

@@ -32,7 +32,8 @@ public:
void clear() {dudes.clear();}
cCreature& operator[](size_t n);
const cCreature& operator[](size_t n) const;
cPopulation() : which_town(200) {}
// ASAN hostile copied but unset
cPopulation() : which_town(200), hostile(false) {}
std::vector<cCreature>::iterator begin() {return dudes.begin();}
std::vector<cCreature>::iterator end() {return dudes.end();}
// Apparently Visual Studio needs this to work