Commit e063f2eb by Thomas Brandého
parents 71a416fc 1d0d55c4
......@@ -26,7 +26,12 @@ MapInstance::~MapInstance()
}
void MapInstance::update()
{
{
if(m_mapdiffs.find(m_current_turn_id) == m_mapdiffs.end()){
m_mapdiffs[m_current_turn_id] = new MapDiff();
m_mapdiffs[m_current_turn_id]->turn_id = m_current_turn_id;
}
std::lock_guard<std::mutex> guard(m_mutex);
filterMapDiff();
sf::Packet packet;
......@@ -35,11 +40,7 @@ void MapInstance::update()
m_server->getSocketHandler()->broadcastMessage(packet);
m_server->getSocketHandler()->removeDisconnectedPlayer();
m_current_turn_id++;
if(m_mapdiffs.find(m_current_turn_id) == m_mapdiffs.end()){
m_mapdiffs[m_current_turn_id] = new MapDiff();
m_mapdiffs[m_current_turn_id]->turn_id = m_current_turn_id;
}
++m_current_turn_id;
}
void MapInstance::setMapData(const MapKoban &new_map)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment