X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FArea.cpp;h=9c066d646f021a0b8d0d644bb6806fbb5f98622d;hb=ed792d6d00d822384d79d049e644e372f7c3b4cd;hp=6b3f9b186373714aa384748e7a3ba10eb8f19b22;hpb=7fb774ec1df3d550cd8a6805bdc69c11ad36e498;p=l2e.git diff --git a/src/map/Area.cpp b/src/map/Area.cpp index 6b3f9b1..9c066d6 100644 --- a/src/map/Area.cpp +++ b/src/map/Area.cpp @@ -25,12 +25,12 @@ Area::Area() } -const Tile &Area::TileAt(const geometry::Vector &offset) const { +const Tile *Area::TileAt(const geometry::Vector &offset) const { int tileIndex(offset.Y() * width + offset.X()); if (tileIndex < numTiles) { - return tiles[tileIndex]; + return tiles +tileIndex; } else { - throw std::out_of_range("tile index out of range"); + return 0; } }