Fix for "front() called on empty vector" Errors on debug builds.
Now using the C++11 vector.data() to fetch the proper pointer instead of $vector.front() - Which fails on empty vectors because of the standard compiler setting _ITERATOR_DEBUG_LEVEL=2 when debugging
This commit is contained in:
@@ -3646,7 +3646,7 @@ void Subsystem::init(SaveFile& file) {
|
||||
|
||||
unsigned hexCount = file;
|
||||
hexes.resize(hexCount);
|
||||
file.read(&hexes.front(), hexes.size() * sizeof(vec2u));
|
||||
file.read(hexes.data(), hexes.size() * sizeof(vec2u));
|
||||
hexEffects.resize(hexCount);
|
||||
|
||||
if(file >= SFV_0010) {
|
||||
@@ -3799,7 +3799,7 @@ void Subsystem::save(SaveFile& file) const {
|
||||
file << dataOffset;
|
||||
|
||||
file << unsigned(hexes.size());
|
||||
file.write(&hexes.front(), hexes.size() * sizeof(vec2u));
|
||||
file.write(hexes.data(), hexes.size() * sizeof(vec2u));
|
||||
|
||||
for(unsigned i = 0; i < hexes.size(); ++i) {
|
||||
file << (unsigned)hexEffects[i].size();
|
||||
|
||||
Reference in New Issue
Block a user