mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge remote-tracking branch 'youby/master' into sim
This commit is contained in:
@@ -309,6 +309,11 @@ global_settings::ConfigParse(cParser &Parser) {
|
||||
Parser.getTokens(1, false);
|
||||
Parser >> iMultiplayer;
|
||||
}
|
||||
else if (token == "isolatedtrainnumber")
|
||||
{
|
||||
Parser.getTokens(1, false);
|
||||
Parser >> bIsolatedTrainName;
|
||||
}
|
||||
else if (token == "maxtexturesize")
|
||||
{
|
||||
// wymuszenie przeskalowania tekstur
|
||||
@@ -1226,6 +1231,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
||||
export_as_text( Output, "feedbackmode", iFeedbackMode );
|
||||
export_as_text( Output, "feedbackport", iFeedbackPort );
|
||||
export_as_text( Output, "multiplayer", iMultiplayer );
|
||||
export_as_text( Output, "isolatedtrainnumber", bIsolatedTrainName);
|
||||
export_as_text( Output, "maxtexturesize", iMaxTextureSize );
|
||||
export_as_text( Output, "maxcabtexturesize", iMaxCabTextureSize );
|
||||
export_as_text( Output, "movelight", fMoveLight );
|
||||
|
||||
@@ -204,6 +204,7 @@ struct global_settings {
|
||||
#endif
|
||||
// multiplayer
|
||||
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
||||
bool bIsolatedTrainName{ false }; //wysyłanie zajęcia odcinka izolowanego z nazwą pociągu
|
||||
// other
|
||||
std::string AppName{ "EU07" };
|
||||
std::string asVersion; // z opisem
|
||||
|
||||
@@ -1212,6 +1212,7 @@ public:
|
||||
double InitialCtrlDelay = 0.0; double CtrlDelay = 0.0; /* -//- -//- miedzy kolejnymi poz.*/
|
||||
double CtrlDownDelay = 0.0; /* -//- -//- przy schodzeniu z poz.*/ /*hunter-101012*/
|
||||
int FastSerialCircuit = 0;/*0 - po kolei zamyka styczniki az do osiagniecia szeregowej, 1 - natychmiastowe wejscie na szeregowa*/ /*hunter-111012*/
|
||||
int BackwardsBranchesAllowed = 1;
|
||||
int AutoRelayType = 0; /*0 -brak, 1 - jest, 2 - opcja*/
|
||||
bool CoupledCtrl = false; /*czy mainctrl i scndctrl sa sprzezone*/
|
||||
bool HasCamshaft { false };
|
||||
|
||||
@@ -6803,7 +6803,7 @@ bool TMoverParameters::AutoRelayCheck(void)
|
||||
else
|
||||
{ // zmieniaj mainctrlactualpos
|
||||
if( ( DirActive < 0 ) && ( TrainType != dt_PseudoDiesel ) ) {
|
||||
if( RList[ MainCtrlActualPos + 1 ].Bn > 1 ) {
|
||||
if( RList[ MainCtrlActualPos + 1 ].Bn > BackwardsBranchesAllowed) {
|
||||
return false; // nie poprawiamy przy konwersji
|
||||
// return ARC;// bbylo exit; //Ra: to powoduje, że EN57 nie wyłącza się przy IminLo
|
||||
}
|
||||
@@ -10411,6 +10411,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
||||
( ToLower( extract_value( "FSCircuit", line ) ) == "yes" ) ?
|
||||
1 :
|
||||
0;
|
||||
extract_value( BackwardsBranchesAllowed, "BackwardsBranchesAllowed", line, "" );
|
||||
|
||||
extract_value( StopBrakeDecc, "SBD", line, "" );
|
||||
extract_value( ReleaseParkingBySpringBrake, "ReleaseParkingBySpringBrake", line, "" );
|
||||
|
||||
22
Track.cpp
22
Track.cpp
@@ -21,6 +21,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "MemCell.h"
|
||||
#include "messaging.h"
|
||||
#include "DynObj.h"
|
||||
#include "Driver.h"
|
||||
#include "AnimModel.h"
|
||||
#include "Track.h"
|
||||
#include "Timer.h"
|
||||
@@ -125,8 +126,8 @@ void TIsolated::Modify(int i, TDynamicObject *o)
|
||||
{ // jeśli po zmianie nie ma żadnej osi na odcinku izolowanym
|
||||
if (evFree)
|
||||
simulation::Events.AddToQuery(evFree, o); // dodanie zwolnienia do kolejki
|
||||
if (Global.iMultiplayer) // jeśli multiplayer
|
||||
multiplayer::WyslijString(asName, 10); // wysłanie pakietu o zwolnieniu
|
||||
if (Global.iMultiplayer) // jeśli multiplayer
|
||||
multiplayer::WyslijString(asName, 10); // wysłanie pakietu o zwolnieniu
|
||||
if (pMemCell) // w powiązanej komórce
|
||||
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) & ~0xFF,
|
||||
basic_event::flags::value2 ); //"zerujemy" ostatnią wartość
|
||||
@@ -139,8 +140,21 @@ void TIsolated::Modify(int i, TDynamicObject *o)
|
||||
{
|
||||
if (evBusy)
|
||||
simulation::Events.AddToQuery(evBusy, o); // dodanie zajętości do kolejki
|
||||
if (Global.iMultiplayer) // jeśli multiplayer
|
||||
multiplayer::WyslijString(asName, 11); // wysłanie pakietu o zajęciu
|
||||
if (Global.iMultiplayer) // jeśli multiplayer
|
||||
{
|
||||
auto const *owner = (
|
||||
((o->Mechanik != nullptr) && (o->Mechanik->primary())) ?
|
||||
o->Mechanik :
|
||||
o->ctOwner);
|
||||
auto textline = owner != nullptr ? Bezogonkow(owner->TrainName(), true) : "none";
|
||||
if ("none" != textline && Global.bIsolatedTrainName) {
|
||||
textline = ":" + Bezogonkow(owner->TrainName(), true);
|
||||
}
|
||||
else {
|
||||
textline = "";
|
||||
}
|
||||
multiplayer::WyslijString(asName+textline, 11); // wysłanie pakietu o zajęciu
|
||||
}
|
||||
if (pMemCell) // w powiązanej komórce
|
||||
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) | 1, basic_event::flags::value2 ); // zmieniamy ostatnią wartość na nieparzystą
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user