diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-12-22 01:28:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-12-22 01:28:56 +0300 |
commit | cc7a39f467a49b2e91717739cb6e7c3c4b34a245 (patch) | |
tree | b930d808b5782b77dfa7cd52bbaa902101b8ba06 | |
parent | 2e07d1c5eb79eb291c20da511d0a313f56690756 (diff) | |
download | manaverse-cc7a39f467a49b2e91717739cb6e7c3c4b34a245.tar.gz manaverse-cc7a39f467a49b2e91717739cb6e7c3c4b34a245.tar.bz2 manaverse-cc7a39f467a49b2e91717739cb6e7c3c4b34a245.tar.xz manaverse-cc7a39f467a49b2e91717739cb6e7c3c4b34a245.zip |
Remove default parameters from map.
-rw-r--r-- | src/being/being.cpp | 7 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 20 | ||||
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/resources/map/map.cpp | 20 | ||||
-rw-r--r-- | src/resources/map/map.h | 10 |
5 files changed, 41 insertions, 18 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 1e8ca5efc..ad68a4657 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -543,7 +543,12 @@ void Being::setDestination(const int dstX, if (mMap == nullptr) return; - setPath(mMap->findPath(mX, mY, dstX, dstY, getBlockWalkMask())); + setPath(mMap->findPath(mX, + mY, + dstX, + dstY, + getBlockWalkMask(), + 20)); } void Being::clearPath() restrict2 diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index d336c0e00..135dce434 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1833,8 +1833,11 @@ void LocalPlayer::setHome() if (iter != mHomes.end() && mX == CAST_S32(pos.x) && mY == CAST_S32(pos.y)) { - mMap->updatePortalTile("", MapItemType::EMPTY, - CAST_S32(pos.x), CAST_S32(pos.y)); + mMap->updatePortalTile("", + MapItemType::EMPTY, + CAST_S32(pos.x), + CAST_S32(pos.y), + true); mHomes.erase(key); socialWindow->removePortal(CAST_S32(pos.x), @@ -1852,8 +1855,11 @@ void LocalPlayer::setHome() pos.x = static_cast<float>(mX); pos.y = static_cast<float>(mY); mHomes[key] = pos; - mMap->updatePortalTile("home", MapItemType::HOME, - mX, mY); + mMap->updatePortalTile("home", + MapItemType::HOME, + mX, + mY, + true); socialWindow->addPortal(mX, mY); } MapItem *const mapItem = specialLayer->getTile(mX, mY); @@ -1892,7 +1898,11 @@ void LocalPlayer::setHome() { type = MapItemType::EMPTY; } - mMap->updatePortalTile("", type, mX, mY); + mMap->updatePortalTile("", + type, + mX, + mY, + true); if (type != MapItemType::EMPTY) { diff --git a/src/game.cpp b/src/game.cpp index caea1733b..0457271b5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -660,7 +660,7 @@ void Game::logic() if (particleEngine != nullptr) particleEngine->update(); if (mCurrentMap != nullptr) - mCurrentMap->update(); + mCurrentMap->update(1); BLOCK_END("Game::logic") } diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index 8477b026e..39365643d 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -1180,18 +1180,26 @@ void Map::addExtraLayer() restrict2 } if (type == MapItemType::PORTAL) { - updatePortalTile(comment, type, atoi(x.c_str()), - atoi(y.c_str()), false); + updatePortalTile(comment, + type, + atoi(x.c_str()), + atoi(y.c_str()), + false); } else if (type == MapItemType::HOME) { - updatePortalTile(comment, type, atoi(x.c_str()), - atoi(y.c_str())); + updatePortalTile(comment, + type, + atoi(x.c_str()), + atoi(y.c_str()), + true); } else { - addPortalTile(comment, type, atoi(x.c_str()), - atoi(y.c_str())); + addPortalTile(comment, + type, + atoi(x.c_str()), + atoi(y.c_str())); } } } diff --git a/src/resources/map/map.h b/src/resources/map/map.h index dc05cb2ea..39e4e651e 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -95,7 +95,7 @@ class Map final : public Properties, /** * Updates animations. Called as needed. */ - void update(const int ticks = 1) restrict2; + void update(const int ticks) restrict2; /** * Draws the map to the given graphics output. This method draws all @@ -199,7 +199,7 @@ class Map final : public Properties, Path findPath(const int startX, const int startY, const int destX, const int destY, const unsigned char blockWalkmask, - const int maxCost = 20) restrict2 A_WARN_UNUSED; + const int maxCost) restrict2 A_WARN_UNUSED; /** * Adds a particle effect @@ -207,8 +207,8 @@ class Map final : public Properties, void addParticleEffect(const std::string &restrict effectFile, const int x, const int y, - const int w = 0, - const int h = 0) restrict2; + const int w, + const int h) restrict2; /** * Initializes all added particle effects @@ -262,7 +262,7 @@ class Map final : public Properties, void updatePortalTile(const std::string &restrict name, const int type, const int x, const int y, - const bool addNew = true) restrict2; + const bool addNew) restrict2; const STD_VECTOR<MapItem*> &getPortals() const restrict2 noexcept2 A_WARN_UNUSED |