Changeset 233e736 in network-game for common


Ignore:
Timestamp:
Sep 27, 2013, 6:56:04 PM (11 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
master
Children:
a6fe73d
Parents:
d519032
Message:

Fixed a client-side map loading bug

Location:
common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • common/Game.cpp

    rd519032 r233e736  
    1111}
    1212
    13 Game::Game(string name) {
     13Game::Game(string name, string filepath) {
    1414   this->id = 0;
    1515   this->name = name;
    1616   this->blueScore = 0;
    1717   this->redScore = 0;
    18    this->worldMap = WorldMap::loadMapFromFile("../data/map.txt");
     18   this->worldMap = WorldMap::loadMapFromFile(filepath);
    1919}
    2020
  • common/Game.h

    rd519032 r233e736  
    3030public:
    3131   Game();
    32    Game(string name);
     32   Game(string name, string filepath);
    3333
    3434   ~Game();
  • common/WorldMap.cpp

    rd519032 r233e736  
    124124   bool foundObject = false;
    125125
    126    cout << "Searching for obbject to update" << endl;
     126   cout << "Searching for object to update" << endl;
    127127   switch (t) {
    128128   case WorldMap::OBJECT_BLUE_FLAG:
     
    198198   ifstream file(filename.c_str());
    199199
     200   cout << "Trying to open file: " << filename << endl;
     201
    200202   if (file.is_open())
    201203   {
     204      cout << filename << " opened successfully" << endl;
     205
    202206      string line;
    203207      int width, height;
     
    299303      }
    300304      file.close();
     305      cout << filename << " closed" << endl;
    301306   }
    302307   else
    303308      cout << "Could not open the file" << endl;
     309
     310   cout << "Finished file processing" << endl;
    304311
    305312   return m;
Note: See TracChangeset for help on using the changeset viewer.