Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,16 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData )
slot->setColor( pref.getPreferredColor() );
slot->setPlayerTemplate( pref.getPreferredFaction() );
slot->setNATBehavior(FirewallHelperClass::FIREWALL_TYPE_SIMPLE);
game->setMap( pref.getPreferredMap() );
AsciiString lowerMap = pref.getPreferredMap();
lowerMap.toLower();
std::map<AsciiString, MapMetaData>::iterator it = TheMapCache->find(lowerMap);
if (it != TheMapCache->end())
AsciiString mapName = pref.getPreferredMap();
const MapMetaData *mapData = TheMapCache->findMap(mapName);
if (mapData != nullptr)
mapName = mapData->m_fileName;
game->setMap(mapName);
if (mapData != nullptr)
{
TheLAN->GetMyGame()->getSlot(0)->setMapAvailability(true);
TheLAN->GetMyGame()->setMapCRC( it->second.m_CRC );
TheLAN->GetMyGame()->setMapSize( it->second.m_filesize );
TheLAN->GetMyGame()->setMapCRC( mapData->m_CRC );
TheLAN->GetMyGame()->setMapSize( mapData->m_filesize );

TheLAN->GetMyGame()->adjustSlotsForMap(); // BGC- adjust the slots for the selected map.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,17 +856,18 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData )
slot->setColor( pref.getPreferredColor() );
slot->setPlayerTemplate( pref.getPreferredFaction() );
slot->setNATBehavior(FirewallHelperClass::FIREWALL_TYPE_SIMPLE);
game->setMap( pref.getPreferredMap() );
AsciiString mapName = pref.getPreferredMap();
const MapMetaData *mapData = TheMapCache->findMap(mapName);
if (mapData != nullptr)
mapName = mapData->m_fileName;
game->setMap(mapName);
game->setStartingCash( pref.getStartingCash() );
game->setSuperweaponRestriction( pref.getSuperweaponRestricted() ? 1 : 0 );
AsciiString lowerMap = pref.getPreferredMap();
lowerMap.toLower();
std::map<AsciiString, MapMetaData>::iterator it = TheMapCache->find(lowerMap);
if (it != TheMapCache->end())
if (mapData != nullptr)
{
TheLAN->GetMyGame()->getSlot(0)->setMapAvailability(true);
TheLAN->GetMyGame()->setMapCRC( it->second.m_CRC );
TheLAN->GetMyGame()->setMapSize( it->second.m_filesize );
TheLAN->GetMyGame()->setMapCRC( mapData->m_CRC );
TheLAN->GetMyGame()->setMapSize( mapData->m_filesize );

TheLAN->GetMyGame()->adjustSlotsForMap(); // BGC- adjust the slots for the selected map.
}
Expand Down
Loading