Load from file

I made an RPG game, with a map manager, I have now decided to try to make a tower defence game, and think I should use this. I removed some things and the program seems to have stopped working. I get the problem R6010, abort() called. I debugged and think the problem is here:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
std::string temp;
	std::ifstream mapFile("Graphics/maps/" + filename);

	std::getline(mapFile, this->tileSet);

	std::getline(mapFile, temp);
	this->tileWidth = std::stol(temp, nullptr);
	std::getline(mapFile, temp);
	this->tileHeight = std::stol(temp, nullptr);
	std::getline(mapFile, temp);
	this->width = std::stol(temp, nullptr);
	std::getline(mapFile, temp);
	this->height = std::stol(temp, nullptr);

	this->data = new int[this->tileWidth * this->tileHeight];
	for (int y = 0; y < this->height; y++){
		for (int x = 0; x < this->width; x++){
			char temp;
			mapFile >> this->data[x + y*this->width] >> temp;
		}
	}
	mapFile.close();
Topic archived. No new replies allowed.