summaryrefslogtreecommitdiff
path: root/src/game-server/map.cpp
diff options
context:
space:
mode:
authorRoderic Morris <roderic@ccs.neu.edu>2008-07-03 13:31:58 +0000
committerRoderic Morris <roderic@ccs.neu.edu>2008-07-03 13:31:58 +0000
commitb4277aadb5c24b3459f7085bcdb8911fdb70799d (patch)
tree7bfee742bff4463fedcd15f392ab0a7d2fd564ab /src/game-server/map.cpp
parentbb8623fa6e5584adeee6a613b3a28cb5550048d9 (diff)
downloadmanaserv-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.cpp18
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];