16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 05:29:17 +02:00

partial replacement of char arrays with std::string; minor updates, fixes and cleanup of mctools

This commit is contained in:
tmj-fstate
2017-01-29 18:12:18 +01:00
parent c3d79e29e2
commit 3c0edb3ec3
10 changed files with 211 additions and 132 deletions

View File

@@ -36,19 +36,21 @@ TEventLauncher::TEventLauncher()
DeltaTime = -1;
UpdatedTime = 0;
fVal1 = fVal2 = 0;
#ifdef EU07_USE_OLD_TEVENTLAUNCHER_TEXT_ARRAY
szText = NULL;
#endif
iHour = iMinute = -1; // takiego czasu nigdy nie będzie
dRadius = 0;
Event1 = Event2 = NULL;
MemCell = NULL;
iCheckMask = 0;
}
#ifdef EU07_USE_OLD_TEVENTLAUNCHER_TEXT_ARRAY
TEventLauncher::~TEventLauncher()
{
SafeDeleteArray(szText);
}
#endif
void TEventLauncher::Init()
{
}
@@ -105,17 +107,20 @@ bool TEventLauncher::Load(cParser *parser)
asMemCellName = token;
parser->getTokens();
*parser >> token;
#ifdef EU07_USE_OLD_TEVENTLAUNCHER_TEXT_ARRAY
SafeDeleteArray(szText);
szText = new char[256];
strcpy(szText, token.c_str());
if (token.compare("*") != 0) //*=nie brać command pod uwagę
#else
szText = token;
#endif
if (token != "*") //*=nie brać command pod uwagę
iCheckMask |= conditional_memstring;
parser->getTokens();
*parser >> token;
if (token.compare("*") != 0) //*=nie brać wartości 1. pod uwagę
if (token != "*") //*=nie brać wartości 1. pod uwagę
{
iCheckMask |= conditional_memval1;
//str = AnsiString(token.c_str());
fVal1 = atof(token.c_str());
}
else
@@ -125,7 +130,6 @@ bool TEventLauncher::Load(cParser *parser)
if (token.compare("*") != 0) //*=nie brać wartości 2. pod uwagę
{
iCheckMask |= conditional_memval2;
//str = AnsiString(token.c_str());
fVal2 = atof(token.c_str());
}
else