#include "stdafx.h" #include "rmgen.h" #include "map.h" using namespace std; Map::Map(int size, const string& baseTerrain, float baseHeight) { if(size<0 || size>1024) { JS_ReportError(cx, "init: map size out of range"); } else if(size%16 != 0) { JS_ReportError(cx, "init: map size must be divisble by 16"); } this->size = size; int baseId = getId(baseTerrain); terrain = new int*[size]; for(int i=0; i=0 && y>=0 && x=0 && y>=0 && x