diff options
author | Roderic Morris <roderic@ccs.neu.edu> | 2008-07-03 13:31:58 +0000 |
---|---|---|
committer | Roderic Morris <roderic@ccs.neu.edu> | 2008-07-03 13:31:58 +0000 |
commit | b4277aadb5c24b3459f7085bcdb8911fdb70799d (patch) | |
tree | 7bfee742bff4463fedcd15f392ab0a7d2fd564ab /src/game-server/map.cpp | |
parent | bb8623fa6e5584adeee6a613b3a28cb5550048d9 (diff) | |
download | manaserv-b4277aadb5c24b3459f7085bcdb8911fdb70799d.tar.gz manaserv-b4277aadb5c24b3459f7085bcdb8911fdb70799d.tar.bz2 manaserv-b4277aadb5c24b3459f7085bcdb8911fdb70799d.tar.xz manaserv-b4277aadb5c24b3459f7085bcdb8911fdb70799d.zip |
avoid map reading crash, arbitrary tile sizes, enable new maps
Diffstat (limited to 'src/game-server/map.cpp')
-rw-r--r-- | src/game-server/map.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/game-server/map.cpp b/src/game-server/map.cpp index 8f6dacc7..238c0837 100644 --- a/src/game-server/map.cpp +++ b/src/game-server/map.cpp @@ -45,23 +45,9 @@ bool Location::operator< (const Location &loc) const return tile->Fcost > loc.tile->Fcost; } - -Map::Map(): - mWidth(0), mHeight(0), - tileWidth(32), tileHeight(32), - onClosedList(1), onOpenList(2) -{ - mMetaTiles = new MetaTile[mWidth * mHeight]; - for (int i=0; i < NB_BLOCKTYPES; i++) - { - mOccupation[i] = new int[mWidth * mHeight]; - memset(mOccupation[i], 0, mWidth * mHeight * sizeof(int)); - } -} - -Map::Map(int width, int height): +Map::Map(int width, int height, int twidth, int theight): mWidth(width), mHeight(height), - tileWidth(32), tileHeight(32), + tileWidth(twidth), tileHeight(theight), onClosedList(1), onOpenList(2) { mMetaTiles = new MetaTile[mWidth * mHeight]; |