| 742 | } |
| 743 | |
| 744 | void MapLoader::LoadProcedure( |
| 745 | const unsigned int procedure_number, |
| 746 | std::istringstream& stream, |
| 747 | MapData& map_data ) |
| 748 | { |
| 749 | if( procedure_number >= map_data.procedures.size() ) |
| 750 | map_data.procedures.resize( procedure_number + 1u ); |
| 751 | MapData::Procedure& procedure= map_data.procedures[ procedure_number ]; |
| 752 | |
| 753 | bool has_action= false; |
| 754 | |
| 755 | while( !stream.eof() ) |
| 756 | { |
| 757 | char line[ 512 ]; |
| 758 | stream.getline( line, sizeof(line), '\n' ); |
| 759 | |
| 760 | if( stream.eof() ) |
| 761 | break; |
| 762 | |
| 763 | std::istringstream line_stream{ std::string( line ) }; |
| 764 | |
| 765 | char thing[64]; |
| 766 | line_stream >> thing; |
| 767 | |
| 768 | if( line_stream.fail() ) |
| 769 | continue; |
| 770 | if( StringEquals( thing, "#end" ) ) |
| 771 | break; |
| 772 | if( thing[0] == ';' ) |
| 773 | continue; |
| 774 | |
| 775 | else if( StringEquals( thing, "StartDelay" ) ) |
| 776 | line_stream >> procedure.start_delay_s; |
| 777 | else if( StringEquals( thing, "EndDelay" ) ) |
| 778 | line_stream >> procedure.end_delay_s; |
| 779 | else if( StringEquals( thing, "BackWait" ) ) |
| 780 | line_stream >> procedure.back_wait_s; |
| 781 | else if( StringEquals( thing, "Speed" ) ) |
| 782 | line_stream >> procedure.speed; |
| 783 | else if( StringEquals( thing, "checkgo" ) ) |
| 784 | procedure.check_go= true; |
| 785 | else if( StringEquals( thing, "checkback" ) ) |
| 786 | procedure.check_back= true; |
| 787 | else if( StringEquals( thing, "Mortal" ) ) |
| 788 | procedure.mortal= true; |
| 789 | else if( StringEquals( thing, "LightRemap" ) ) |
| 790 | line_stream >> procedure.light_remap; |
| 791 | else if( StringEquals( thing, "Lock" ) && !has_action ) // Distinguish property "lock" and action command "lock". |
| 792 | procedure.locked= true; |
| 793 | else if( StringEquals( thing, "OnMessage" ) ) |
| 794 | line_stream >> procedure.on_message_number; |
| 795 | else if( StringEquals( thing, "FirstMessage" ) ) |
| 796 | line_stream >> procedure.first_message_number; |
| 797 | else if( StringEquals( thing, "LockMessage" ) ) |
| 798 | line_stream >> procedure.lock_message_number; |
| 799 | else if( StringEquals( thing, "SfxId" ) ) |
| 800 | line_stream >> procedure.sfx_id; |
| 801 | else if( StringEquals( thing, "SfxPosxy" ) ) |
nothing calls this directly
no test coverage detected