Fixed initialization of BlockThingsIterator objects

https://forum.zdoom.org/viewtopic.php?t=58945
This commit is contained in:
alexey.lysiuk 2018-01-01 11:11:21 +02:00
parent 2c4eae7487
commit be8147406e

View file

@ -1275,20 +1275,21 @@ void FMultiBlockThingsIterator::Reset()
// //
//=========================================================================== //===========================================================================
class DBlockThingsIterator : public DObject, public FMultiBlockThingsIterator class DBlockThingsIterator : public DObject
{ {
DECLARE_ABSTRACT_CLASS(DBlockThingsIterator, DObject); DECLARE_ABSTRACT_CLASS(DBlockThingsIterator, DObject);
FPortalGroupArray check; FPortalGroupArray check;
FMultiBlockThingsIterator iterator;
public: public:
FMultiBlockThingsIterator::CheckResult cres; FMultiBlockThingsIterator::CheckResult cres;
bool Next() bool Next()
{ {
return FMultiBlockThingsIterator::Next(&cres); return iterator.Next(&cres);
} }
DBlockThingsIterator(AActor *origin, double checkradius = -1, bool ignorerestricted = false) DBlockThingsIterator(AActor *origin, double checkradius = -1, bool ignorerestricted = false)
: FMultiBlockThingsIterator(check, origin, checkradius, ignorerestricted) : iterator(check, origin, checkradius, ignorerestricted)
{ {
cres.thing = nullptr; cres.thing = nullptr;
cres.Position.Zero(); cres.Position.Zero();
@ -1296,7 +1297,7 @@ public:
} }
DBlockThingsIterator(double checkx, double checky, double checkz, double checkh, double checkradius, bool ignorerestricted, sector_t *newsec) DBlockThingsIterator(double checkx, double checky, double checkz, double checkh, double checkradius, bool ignorerestricted, sector_t *newsec)
: FMultiBlockThingsIterator(check, checkx, checky, checkz, checkh, checkradius, ignorerestricted, newsec) : iterator(check, checkx, checky, checkz, checkh, checkradius, ignorerestricted, newsec)
{ {
cres.thing = nullptr; cres.thing = nullptr;
cres.Position.Zero(); cres.Position.Zero();