Additional check for inactive/disabled characters in Character Catalog added
This commit is contained in:
parent
ff0354474e
commit
a6088c3028
@ -300,7 +300,7 @@ bool ZRCola::DBSource::Open(LPCTSTR filename)
|
|||||||
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comCharacterGroup)));
|
wxVERIFY(SUCCEEDED(::CoCreateInstance(CLSID_CADOCommand, NULL, CLSCTX_ALL, IID_IADOCommand, (LPVOID*)&m_comCharacterGroup)));
|
||||||
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_ActiveConnection(ATL::CComVariant(m_db))));
|
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_ActiveConnection(ATL::CComVariant(m_db))));
|
||||||
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandType(adCmdText)));
|
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandType(adCmdText)));
|
||||||
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandText(ATL::CComBSTR(L"SELECT [Znak] FROM [VRS_SkupineZnakov] WHERE [Skupina]=? ORDER BY [Rang] ASC, [Znak] ASC"))));
|
wxVERIFY(SUCCEEDED(m_comCharacterGroup->put_CommandText(ATL::CComBSTR(L"SELECT [VRS_SkupineZnakov].[Znak] FROM [VRS_SkupineZnakov] LEFT JOIN [VRS_CharList] ON [VRS_SkupineZnakov].[Znak]=[VRS_CharList].[znak] WHERE [VRS_CharList].[aktiven]=1 AND [VRS_SkupineZnakov].[Skupina]=? ORDER BY [VRS_SkupineZnakov].[Rang] ASC, [VRS_SkupineZnakov].[Znak] ASC"))));
|
||||||
{
|
{
|
||||||
// Create and add command parameters.
|
// Create and add command parameters.
|
||||||
ATL::CComPtr<ADOParameters> params;
|
ATL::CComPtr<ADOParameters> params;
|
||||||
|
@ -346,6 +346,11 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
while (!ZRCola::DBSource::IsEOF(rs)) {
|
||||||
// Read character group from the database.
|
// Read character group from the database.
|
||||||
if (src.GetCharacterGroup(rs, cg)) {
|
if (src.GetCharacterGroup(rs, cg)) {
|
||||||
|
if (cg.chars.empty()) {
|
||||||
|
// Skip empty character groups.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Add character group to index and data.
|
// Add character group to index and data.
|
||||||
unsigned __int32 idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
wxASSERT_MSG((int)0xffff8000 <= cg.id && cg.id <= (int)0x00007fff, wxT("character group ID out of bounds"));
|
wxASSERT_MSG((int)0xffff8000 <= cg.id && cg.id <= (int)0x00007fff, wxT("character group ID out of bounds"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user