diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-18 22:13:37 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-18 22:13:37 +0200 |
commit | f4792bc06f21335fc2d1171d937ea7645ca0c253 (patch) | |
tree | c7b11cf81f254f5b9ed2f5dbfe127649abc7545a /src/mumblemanager.cpp | |
parent | f98d003e354a1792117b7cbc771d1dd91475a156 (diff) | |
download | ManaVerse-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.gz ManaVerse-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.bz2 ManaVerse-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.xz ManaVerse-f4792bc06f21335fc2d1171d937ea7645ca0c253.zip |
Fix most conversions except manaserv net code and some other code.
Diffstat (limited to 'src/mumblemanager.cpp')
-rw-r--r-- | src/mumblemanager.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp index b21fac2ee..aa2d49959 100644 --- a/src/mumblemanager.cpp +++ b/src/mumblemanager.cpp @@ -55,18 +55,18 @@ uint16_t MumbleManager::getMapId(std::string mapName) else { mapName = mapName.substr(0, 3) + mapName[4]; - res = atoi(mapName.c_str()); + res = static_cast<uint16_t>(atoi(mapName.c_str())); } return res; } void MumbleManager::setMapBase(uint16_t mapid) { - mMapBase[0] = 10000. * (mapid & 0x1f); + mMapBase[0] = 10000.0f * (mapid & 0x1f); mapid >>= 5; - mMapBase[1] = 1000. * (mapid & 0x3f); + mMapBase[1] = 1000.0f * (mapid & 0x3f); mapid >>= 6; - mMapBase[2] = 10000. * (mapid & 0x1f); + mMapBase[2] = 10000.0f * (mapid & 0x1f); } void MumbleManager::init() @@ -204,8 +204,10 @@ void MumbleManager::setPos(int tileX, int tileY, int direction) // lm->fAvatarPosition /* tmw coordinates work exactly the other way round */ - mLinkedMemCache.fAvatarPosition[0] = tileX + mMapBase[0]; - mLinkedMemCache.fAvatarPosition[2] = tileY + mMapBase[2]; + mLinkedMemCache.fAvatarPosition[0] = static_cast<float>(tileX) + + mMapBase[0]; + mLinkedMemCache.fAvatarPosition[2] = static_cast<float>(tileY) + + mMapBase[2]; // Same as avatar but for the camera. // lm->fCameraPosition, fCameraFront, fCameraTop @@ -260,7 +262,7 @@ void MumbleManager::setServer(const std::string &serverName) if (!mLinkedMem) return; - unsigned size = serverName.size(); + unsigned size = static_cast<unsigned>(serverName.size()); if (size > sizeof(mLinkedMemCache.context) - 1) size = sizeof(mLinkedMemCache.context) - 1; |