mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 04:39:18 +02:00
reformat: use auto on certain types
This commit is contained in:
@@ -150,7 +150,7 @@ shape_node::import( cParser &Input, scene::node_data const &Nodedata ) {
|
||||
m_data.rangesquared_min = Nodedata.range_min * Nodedata.range_min;
|
||||
m_data.rangesquared_max = Nodedata.range_max >= 0.0 ? Nodedata.range_max * Nodedata.range_max : std::numeric_limits<double>::max();
|
||||
|
||||
std::string token = Input.getToken<std::string>();
|
||||
auto token = Input.getToken<std::string>();
|
||||
if( token == "material" ) {
|
||||
// lighting settings
|
||||
token = Input.getToken<std::string>();
|
||||
@@ -588,7 +588,7 @@ lines_node::import( cParser &Input, scene::node_data const &Nodedata ) {
|
||||
subtype const nodetype = Nodedata.type == "lines" ? lines : Nodedata.type == "line_strip" ? line_strip : line_loop;
|
||||
std::size_t vertexcount { 0 };
|
||||
world_vertex vertex, vertex0, vertex1;
|
||||
std::string token = Input.getToken<std::string>();
|
||||
auto token = Input.getToken<std::string>();
|
||||
do {
|
||||
vertex.position.x = std::atof( token.c_str() );
|
||||
Input.getTokens( 2, false );
|
||||
|
||||
@@ -62,7 +62,7 @@ bool node_groups::assign_cross_switch(map::track_switch& sw, std::string &sw_nam
|
||||
if (!sw.action[idx])
|
||||
return false;
|
||||
|
||||
multi_event *multi = dynamic_cast<multi_event*>(sw.action[idx]);
|
||||
auto multi = dynamic_cast<multi_event*>(sw.action[idx]);
|
||||
|
||||
if (!multi)
|
||||
return false;
|
||||
@@ -135,7 +135,7 @@ node_groups::update_map()
|
||||
}
|
||||
|
||||
if (Global.map_manualswitchcontrol) {
|
||||
if (TTrack *track = dynamic_cast<TTrack*>(node)) {
|
||||
if (auto track = dynamic_cast<TTrack*>(node)) {
|
||||
if (track->eType != tt_Switch)
|
||||
continue;
|
||||
|
||||
@@ -203,7 +203,7 @@ node_groups::update_map()
|
||||
last_switch_map.erase(sw_name);
|
||||
}
|
||||
} else {
|
||||
if (TEventLauncher *launcher = dynamic_cast<TEventLauncher*>(node)) {
|
||||
if (auto launcher = dynamic_cast<TEventLauncher*>(node)) {
|
||||
if (!launcher || !launcher->Event1 || !launcher->Event2)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user