mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Throw exception when there are not enough two-way monoliths available.
This commit is contained in:
parent
05c2a4e716
commit
d942858ef9
@ -11,6 +11,7 @@
|
|||||||
#include "CRmgTemplate.h"
|
#include "CRmgTemplate.h"
|
||||||
#include "CRmgTemplateZone.h"
|
#include "CRmgTemplateZone.h"
|
||||||
#include "CZonePlacer.h"
|
#include "CZonePlacer.h"
|
||||||
|
#include "../mapObjects/CObjectClassesHandler.h"
|
||||||
|
|
||||||
void CMapGenerator::foreach_neighbour(const int3 &pos, std::function<void(int3& pos)> foo)
|
void CMapGenerator::foreach_neighbour(const int3 &pos, std::function<void(int3& pos)> foo)
|
||||||
{
|
{
|
||||||
@ -429,5 +430,8 @@ int CMapGenerator::getNearestObjectDistance(const int3 &tile) const
|
|||||||
|
|
||||||
int CMapGenerator::getNextMonlithIndex()
|
int CMapGenerator::getNextMonlithIndex()
|
||||||
{
|
{
|
||||||
|
if (monolithIndex >= VLC->objtypeh->knownSubObjects(Obj::MONOLITH_TWO_WAY).size())
|
||||||
|
throw rmgException(boost::to_string(boost::format("There is no Monolith Two Way with index %d available!") % monolithIndex));
|
||||||
|
else
|
||||||
return monolithIndex++;
|
return monolithIndex++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user