mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 04:39:18 +02:00
Replace starts_with and ends_with with string class methods
This commit is contained in:
@@ -1354,7 +1354,7 @@ void TDynamicObject::ABuLittleUpdate(double ObjSqrDist)
|
||||
if( cabsection ) {
|
||||
// check whether we're still processing cab sections
|
||||
auto const §ionname { section.compartment->pName };
|
||||
cabsection &= ( ( sectionname.size() >= 4 ) && ( starts_with( sectionname, "cab" ) ) );
|
||||
cabsection &= ( ( sectionname.size() >= 4 ) && sectionname.starts_with("cab") );
|
||||
}
|
||||
// TODO: add cablight devices
|
||||
auto const sectionlightlevel { section.light_level * ( cabsection ? 1.0f : MoverParameters->CompartmentLights.intensity ) };
|
||||
@@ -7954,7 +7954,7 @@ material_handle TDynamicObject::DestinationFind( std::string Destination ) {
|
||||
|
||||
auto destinationhandle { null_handle };
|
||||
|
||||
if( starts_with( Destination, "make:" ) ) {
|
||||
if( Destination.starts_with("make:") ) {
|
||||
// autogenerated texture
|
||||
destinationhandle = GfxRenderer->Fetch_Material( Destination );
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ TGauge::Load_mapping( cParser &Input, TGauge::scratch_data &Scratchpad ) {
|
||||
>> soundproofing[ 5 ];
|
||||
Scratchpad.soundproofing = soundproofing;
|
||||
}
|
||||
else if( starts_with( key, "sound" ) ) {
|
||||
else if( key.starts_with("sound") ) {
|
||||
// sounds assigned to specific gauge values, defined by key soundX: where X = value
|
||||
auto const indexstart { key.find_first_of( "-1234567890" ) };
|
||||
auto const indexend { key.find_first_not_of( "-1234567890", indexstart ) };
|
||||
|
||||
Reference in New Issue
Block a user