mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
dangling pointer crash semi-fix, minor bug fixes, minor code correctness enhancements
This commit is contained in:
16
Event.cpp
16
Event.cpp
@@ -297,37 +297,37 @@ void TEvent::Load(cParser *parser, Math3D::vector3 const &org)
|
||||
if (token.find('#') != std::string::npos)
|
||||
token.erase(token.find('#')); // obcięcie unikatowości
|
||||
win1250_to_ascii( token ); // get rid of non-ascii chars
|
||||
Params[6].asCommand = cm_PassengerStopPoint;
|
||||
Params[6].asCommand = TCommandType::cm_PassengerStopPoint;
|
||||
// nie do kolejki (dla SetVelocity też, ale jak jest do toru dowiązany)
|
||||
bEnabled = false;
|
||||
}
|
||||
else if (token == "SetVelocity")
|
||||
{
|
||||
bEnabled = false;
|
||||
Params[6].asCommand = cm_SetVelocity;
|
||||
Params[6].asCommand = TCommandType::cm_SetVelocity;
|
||||
}
|
||||
else if (token == "RoadVelocity")
|
||||
{
|
||||
bEnabled = false;
|
||||
Params[6].asCommand = cm_RoadVelocity;
|
||||
Params[6].asCommand = TCommandType::cm_RoadVelocity;
|
||||
}
|
||||
else if (token == "SectionVelocity")
|
||||
{
|
||||
bEnabled = false;
|
||||
Params[6].asCommand = cm_SectionVelocity;
|
||||
Params[6].asCommand = TCommandType::cm_SectionVelocity;
|
||||
}
|
||||
else if (token == "ShuntVelocity")
|
||||
{
|
||||
bEnabled = false;
|
||||
Params[6].asCommand = cm_ShuntVelocity;
|
||||
Params[6].asCommand = TCommandType::cm_ShuntVelocity;
|
||||
}
|
||||
else if (token == "OutsideStation")
|
||||
{
|
||||
bEnabled = false; // ma być skanowny, aby AI nie przekraczało W5
|
||||
Params[6].asCommand = cm_OutsideStation;
|
||||
Params[6].asCommand = TCommandType::cm_OutsideStation;
|
||||
}
|
||||
else
|
||||
Params[6].asCommand = cm_Unknown;
|
||||
Params[6].asCommand = TCommandType::cm_Unknown;
|
||||
Params[0].asText = new char[token.size() + 1];
|
||||
strcpy(Params[0].asText, token.c_str());
|
||||
parser->getTokens();
|
||||
@@ -817,7 +817,7 @@ TCommandType TEvent::Command()
|
||||
case tp_PutValues:
|
||||
return Params[6].asCommand; // komenda zakodowana binarnie
|
||||
}
|
||||
return cm_Unknown; // inne eventy się nie liczą
|
||||
return TCommandType::cm_Unknown; // inne eventy się nie liczą
|
||||
};
|
||||
|
||||
double TEvent::ValueGet(int n)
|
||||
|
||||
Reference in New Issue
Block a user