mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-29 20:57:32 +01:00
refactor(sonar): rename locals that shadow outer declarations (cpp:S1117)
Only local variables and definition parameters are renamed; shadowing struct fields and enumerators in headers are left for a separate change.
This commit is contained in:
@@ -355,19 +355,19 @@ drivermouse_input::button( int const Button, int const Action ) {
|
||||
// if not release then it's press
|
||||
m_pickwaiting = true;
|
||||
GfxRenderer->Pick_Control_Callback(
|
||||
[this, Button, Action, &mousecommand](TSubModel const *control, const glm::vec2 pos) {
|
||||
[this, Button, Action, &mousecommand](TSubModel const *controlsubmodel, const glm::vec2 pos) {
|
||||
|
||||
bool pickwaiting = m_pickwaiting;
|
||||
m_pickwaiting = false;
|
||||
|
||||
// click on python screen
|
||||
if (Button == GLFW_MOUSE_BUTTON_LEFT
|
||||
&& control && control->screen_touch_list) {
|
||||
&& controlsubmodel && controlsubmodel->screen_touch_list) {
|
||||
|
||||
control->screen_touch_list->emplace_back(pos);
|
||||
controlsubmodel->screen_touch_list->emplace_back(pos);
|
||||
}
|
||||
|
||||
auto const [leftbinding, rightbinding]{ bindings( simulation::Train->GetLabel( control ) ) };
|
||||
auto const [leftbinding, rightbinding]{ bindings( simulation::Train->GetLabel( controlsubmodel ) ) };
|
||||
// if the recognized element under the cursor has a command associated with the pressed button, notify the recipient
|
||||
mousecommand = Button == GLFW_MOUSE_BUTTON_LEFT ? leftbinding : rightbinding;
|
||||
|
||||
|
||||
@@ -62,13 +62,13 @@ OnCommandGet(multiplayer::DaneRozkaz *pRozkaz)
|
||||
std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) + " rcvd" );
|
||||
|
||||
if( Global.iMultiplayer ) {
|
||||
auto *event = simulation::Events.FindEvent( std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) );
|
||||
if (event != nullptr && (typeid(*event) == typeid(multi_event)
|
||||
|| typeid(*event) == typeid(lights_event)
|
||||
|| event->m_sibling != nullptr)) {
|
||||
auto *foundevent = simulation::Events.FindEvent( std::string( pRozkaz->cString + 1, (unsigned)pRozkaz->cString[0] ) );
|
||||
if (foundevent != nullptr && (typeid(*foundevent) == typeid(multi_event)
|
||||
|| typeid(*foundevent) == typeid(lights_event)
|
||||
|| foundevent->m_sibling != nullptr)) {
|
||||
// tylko jawne albo niejawne Multiple
|
||||
command_relay relay;
|
||||
relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &event->name());
|
||||
command_relay commandrelay;
|
||||
commandrelay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &foundevent->name());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user