fix: release() caused loop by calling activate
Dieser Commit ist enthalten in:
Ursprung
712b317221
Commit
bdcb5574f8
@ -140,9 +140,13 @@ Train::Train(World& world, std::string_view _id) :
|
||||
vehicles{this, "vehicles", nullptr, PropertyFlags::ReadOnly | PropertyFlags::Store | PropertyFlags::SubObject},
|
||||
powered{this, "powered", false, PropertyFlags::ReadOnly | PropertyFlags::NoStore | PropertyFlags::ScriptReadOnly},
|
||||
active{this, "active", false, PropertyFlags::ReadWrite | PropertyFlags::StoreState | PropertyFlags::ScriptReadOnly,
|
||||
[this](bool)
|
||||
[this](bool value)
|
||||
{
|
||||
updateSpeed();
|
||||
if(!value && m_throttle)
|
||||
{
|
||||
m_throttle->release();
|
||||
}
|
||||
},
|
||||
std::bind(&Train::setTrainActive, this, std::placeholders::_1)},
|
||||
mode{this, "mode", TrainMode::ManualUnprotected, PropertyFlags::ReadWrite | PropertyFlags::StoreState | PropertyFlags::ScriptReadOnly},
|
||||
@ -440,11 +444,6 @@ bool Train::setTrainActive(bool val)
|
||||
assert(vehicle->activeTrain.value() == self);
|
||||
vehicle->activeTrain.setValueInternal(nullptr);
|
||||
}
|
||||
|
||||
if(m_throttle)
|
||||
{
|
||||
m_throttle->release();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren