Commits

Mihael Peklar committed 0f6e8c3

Removed some debug code: ready for agencies!

Comments (0)

Files changed (1)

 
 void Map::addUnit(Unit* x)
 {
+	int c=this->findTile(x->getX(), x->getY());
+	if(c<0 || c>=this->tiles.size())
+		return;
 	units.push_back(x);
+	blocked[c]=1;
 	//std::sort(units.begin(), units.end(), Unit::distanceCompare);
 }
 
 			dot.push(pnode(d+distance(c, c+tilesPerRow), c+tilesPerRow, mem.size()-1));
 		//printf("STEP\n");
 	}
-	//blocked[s]=1;
+	blocked[s]=1;
 	if(b)
 		return res;
 	//Commented out for testing purposes
-	//blocked[s]=0;
-	//blocked[e]=1;
+	blocked[s]=0;
+	blocked[e]=1;
 	for(int i=mem.size()-1; mem[i].second>=0; i=mem[i].second)
 		res.push_back(mem[i].first);
 	return res;