X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=inline;f=src%2Fmap%2FArea.cpp;fp=src%2Fmap%2FArea.cpp;h=985dea2d5462f4aae5ecba7663d6c79651f635d3;hb=0ad5ca97b5df217329bc319d62564a9f46ba11d7;hp=9c066d646f021a0b8d0d644bb6806fbb5f98622d;hpb=3f9f41338d8100a719e161a3a1cdda9dd227e2b4;p=l2e.git diff --git a/src/map/Area.cpp b/src/map/Area.cpp index 9c066d6..985dea2 100644 --- a/src/map/Area.cpp +++ b/src/map/Area.cpp @@ -18,13 +18,23 @@ using geometry::Vector; namespace map { Area::Area() -: tiles(0) +: battlebg(0) +, tiles(0) , numTiles(0) , width(0) { } +Tile *Area::TileAt(const geometry::Vector &offset) { + int tileIndex(offset.Y() * width + offset.X()); + if (tileIndex < numTiles) { + return tiles +tileIndex; + } else { + return 0; + } +} + const Tile *Area::TileAt(const geometry::Vector &offset) const { int tileIndex(offset.Y() * width + offset.X()); if (tileIndex < numTiles) {