| 848 | } |
| 849 | |
| 850 | void MapLoader::LoadLinks( std::istringstream& stream, MapData& map_data ) |
| 851 | { |
| 852 | while( !stream.eof() ) |
| 853 | { |
| 854 | char line[ 512 ]; |
| 855 | stream.getline( line, sizeof(line), '\n' ); |
| 856 | |
| 857 | if( stream.eof() ) |
| 858 | break; |
| 859 | |
| 860 | std::istringstream line_stream{ std::string( line ) }; |
| 861 | |
| 862 | char link_type[512]; |
| 863 | line_stream >> link_type; |
| 864 | if( line_stream.fail() ) |
| 865 | continue; |
| 866 | if( link_type[0] == ';' ) |
| 867 | continue; |
| 868 | if( StringEquals( link_type, "#end" ) ) |
| 869 | break; |
| 870 | |
| 871 | map_data.links.emplace_back(); |
| 872 | MapData::Link& link= map_data.links.back(); |
| 873 | |
| 874 | unsigned short x, y, proc_id; |
| 875 | line_stream >> x; |
| 876 | line_stream >> y; |
| 877 | line_stream >> proc_id; |
| 878 | |
| 879 | link.x= x; |
| 880 | link.y= y; |
| 881 | link.proc_id= proc_id; |
| 882 | link.type= LinkTypeFromString( link_type ); |
| 883 | } |
| 884 | } |
| 885 | |
| 886 | void MapLoader::LoadTeleports( std::istringstream& stream, MapData& map_data ) |
| 887 | { |
nothing calls this directly
no test coverage detected