I've done a bit of research on Hydro's bug. Now that I've merged the files it is in fact giving us a problem on the current svn. (Not in the code per se... I don't think so anyhow.)
It appears we have a problem in the routes structure somewhere.
This line comes up as the last reportable line in the call stack:
Code:
> CvGameCoreDLL.dll!std::vector<CvRouteInfo *,std::allocator<CvRouteInfo *> >::iterator::operator+(int _Off=39) Line 264 + 0xf bytes C++
And this is the section it's pointing to in vector (I stopped copying this function where the call stack is pointing but it went on to have an actual issue in the exe itself of course):
Code:
// vector standard header
#pragma once
#ifndef _VECTOR_
#define _VECTOR_
#include <memory>
#include <stdexcept>
#pragma pack(push,8)
#pragma warning(push,3)
#pragma warning(disable: 4244)
_STD_BEGIN
// TEMPLATE CLASS _Vector_val
template<class _Ty, class _Alloc>
class _Vector_val
{ // base class for vector to hold allocator _Alval
protected:
_Vector_val(_Alloc _Al = _Alloc())
: _Alval(_Al)
{ // construct allocator from _Al
}
typedef typename _Alloc::template
rebind<_Ty>::other _Alty;
_Alty _Alval; // allocator object for values
};
// TEMPLATE CLASS vector
template<class _Ty,
class _Ax = allocator<_Ty> >
class vector
: public _Vector_val<_Ty, _Ax>
{ // varying size array of values
public:
typedef vector<_Ty, _Ax> _Myt;
typedef _Vector_val<_Ty, _Ax> _Mybase;
typedef typename _Mybase::_Alty _Alloc;
typedef _Alloc allocator_type;
typedef typename _Alloc::size_type size_type;
typedef typename _Alloc::difference_type _Dift;
typedef _Dift difference_type;
typedef typename _Alloc::pointer _Tptr;
typedef typename _Alloc::const_pointer _Ctptr;
typedef _Tptr pointer;
typedef _Ctptr const_pointer;
typedef typename _Alloc::reference _Reft;
typedef _Reft reference;
typedef typename _Alloc::const_reference const_reference;
typedef typename _Alloc::value_type value_type;
#define _ITER_BASE(it) (it)._Myptr
// CLASS const_iterator
class const_iterator;
friend class const_iterator;
class const_iterator
: public _Ranit<_Ty, _Dift, _Ctptr, const_reference>
{ // iterator for nonmutable vector
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef _Dift difference_type;
typedef _Ctptr pointer;
typedef const_reference reference;
const_iterator()
{ // construct with null pointer
_Myptr = 0;
}
const_iterator(_Tptr _Ptr)
{ // construct with pointer _Ptr
_Myptr = _Ptr;
}
const_reference operator*() const
{ // return designated object
return (*_Myptr);
}
_Ctptr operator->() const
{ // return pointer to class object
return (&**this);
}
const_iterator& operator++()
{ // preincrement
++_Myptr;
return (*this);
}
const_iterator operator++(int)
{ // postincrement
const_iterator _Tmp = *this;
++*this;
return (_Tmp);
}
const_iterator& operator--()
{ // predecrement
--_Myptr;
return (*this);
}
const_iterator operator--(int)
{ // postdecrement
const_iterator _Tmp = *this;
--*this;
return (_Tmp);
}
const_iterator& operator+=(difference_type _Off)
{ // increment by integer
_Myptr += _Off;
return (*this);
}
const_iterator operator+(difference_type _Off) const
{ // return this + integer
const_iterator _Tmp = *this;
return (_Tmp += _Off);
}
const_iterator& operator-=(difference_type _Off)
{ // decrement by integer
return (*this += -_Off);
}
const_iterator operator-(difference_type _Off) const
{ // return this - integer
const_iterator _Tmp = *this;
return (_Tmp -= _Off);
}
difference_type operator-(const const_iterator& _Right) const
{ // return difference of iterators
return (_Myptr - _Right._Myptr);
}
const_reference operator[](difference_type _Off) const
{ // subscript
return (*(*this + _Off));
}
bool operator==(const const_iterator& _Right) const
{ // test for iterator equality
return (_Myptr == _Right._Myptr);
}
bool operator!=(const const_iterator& _Right) const
{ // test for iterator inequality
return (!(*this == _Right));
}
bool operator<(const const_iterator& _Right) const
{ // test if this < _Right
return (_Myptr < _Right._Myptr);
}
bool operator>(const const_iterator& _Right) const
{ // test if this > _Right
return (_Right < *this);
}
bool operator<=(const const_iterator& _Right) const
{ // test if this <= _Right
return (!(_Right < *this));
}
bool operator>=(const const_iterator& _Right) const
{ // test if this >= _Right
return (!(*this < _Right));
}
friend const_iterator operator+(difference_type _Off,
const const_iterator& _Right)
{ // return iterator + integer
return (_Right + _Off);
}
_Tptr _Myptr; // offset of element in vector
};
// CLASS iterator
class iterator;
friend class iterator;
class iterator
: public const_iterator
{ // iterator for mutable vector
public:
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef _Dift difference_type;
typedef _Tptr pointer;
typedef _Reft reference;
iterator()
{ // construct with null vector pointer
}
iterator(pointer _Ptr)
: const_iterator(_Ptr)
{ // construct with pointer _Ptr
}
reference operator*() const
{ // return designated object
return ((reference)**(const_iterator *)this);
}
_Tptr operator->() const
{ // return pointer to class object
return (&**this);
}
iterator& operator++()
{ // preincrement
++this->_Myptr;
return (*this);
}
iterator operator++(int)
{ // postincrement
iterator _Tmp = *this;
++*this;
return (_Tmp);
}
iterator& operator--()
{ // predecrement
--this->_Myptr;
return (*this);
}
iterator operator--(int)
{ // postdecrement
iterator _Tmp = *this;
--*this;
return (_Tmp);
}
iterator& operator+=(difference_type _Off)
{ // increment by integer
this->_Myptr += _Off;
return (*this);
}
iterator operator+(difference_type _Off) const
{ // return this + integer
iterator _Tmp = *this;
return (_Tmp += _Off);
}
From all this I am led to believe some recent change in our Improvements, particularly among routes, is causing trouble. It MAY be trouble that's due to his particular game gaining a lot of new land out of the ocean tiles but since it loads before any recent code changes (except perhaps for ls612's recent stuff which I don't THINK has much to do with anything) I'm suspicious of any Improvement info changes made recently.
@Hydro: You could help us by finding the exact revision that it starts crashing at. The change causing trouble is somewhere in that revision.
So unfortunately, this means my update won't fix Hydro's save but we ARE a step closer at figuring out what's wrong.
@Koshling: If you're reading this, do you have any insight as to what this bug report could be pointing at?