summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-01 00:14:51 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-01 00:14:51 +0000
commit05f71c98af1bc9d9aabf3e8e3dc78cae75675e1c (patch)
tree921b18da0dc52e7562f0c6a02e5343f9b582cf64 /src/game.cpp
parent78c72d1463735ad6e3a176f89d3c41a5ed71fc40 (diff)
downloadmana-05f71c98af1bc9d9aabf3e8e3dc78cae75675e1c.tar.gz
mana-05f71c98af1bc9d9aabf3e8e3dc78cae75675e1c.tar.bz2
mana-05f71c98af1bc9d9aabf3e8e3dc78cae75675e1c.tar.xz
mana-05f71c98af1bc9d9aabf3e8e3dc78cae75675e1c.zip
* The client will now only attempt to load .tmx or .tmx.gz files.
* When unable to connect to char server, report IP to which it can't connect. * Cleaned up logger a bit.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b7fd9f86..19a4c88f 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -125,19 +125,23 @@ void game() {
void do_init()
{
- /*tiledMap = Map::load(map_path);
- std::cout << map_path << std::endl;*/
std::string path(map_path);
+ std::string pathDir = path.substr(0, path.rfind("."));
- std::string pathDir = path.substr(0, path.rfind(".") + 1);
- pathDir.insert(pathDir.size(), "tmx");
-
- //tiledMap = Map::load("data/maps/new_3-1.tmx.gz");
- //std::cout << pathDir << std::endl;
- tiledMap = Map::load(map_path);
+ // Try .tmx map file
+ pathDir.insert(pathDir.size(), ".tmx");
+ tiledMap = Map::load(pathDir);
- if (!tiledMap) {
- logger.error("Could not find map file");
+ if (!tiledMap)
+ {
+ // Try .tmx.gz map file
+ pathDir.insert(pathDir.size(), ".gz");
+ tiledMap = Map::load(pathDir);
+
+ if (!tiledMap)
+ {
+ logger.error("Could not find map file!");
+ }
}
// Start playing background music