Subversion Repositories spk

Rev

Rev 88 | Rev 91 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88 Rev 89
Line 5414... Line 5414...
5414
		if ( wp->type == type ) {
5414
		if ( wp->type == type ) {
5415
			if ( wp->type == Ware_Custom && !wp->id.Compare(id) ) continue;
5415
			if ( wp->type == Ware_Custom && !wp->id.Compare(id) ) continue;
5416
			else if ( wp->type != Ware_Custom && wp->pos != pos ) continue;
5416
			else if ( wp->type != Ware_Custom && wp->pos != pos ) continue;
5417
			if ( noto ) {
5417
			if ( noto ) {
5418
				wp->notority  = value;
5418
				wp->notority  = value;
5419
				wp->bNotority = value;
5419
				wp->bNotority = true;
5420
			}
5420
			}
5421
			else wp->relval = value;
5421
			else wp->relval = value;
5422
			return;
5422
			return;
5423
		}
5423
		}
5424
	}
5424
	}
Line 6991... Line 6991...
6991
			WriteFile.remove();
6991
			WriteFile.remove();
6992
		}
6992
		}
6993
	}
6993
	}
6994
}
6994
}
6995
 
6995
 
6996
bool CPackages::readWares(Utils::CStringList &list)
6996
bool CPackages::readWares(int iLang, CLinkList<SWareEntry> &list)
6997
{
6997
{
6998
	CTextDB text;
-
 
6999
	// read through all text files and extract all the used wares
-
 
7000
	for(CListNode<C_File> *node = m_lFiles.Front(); node; node = node->next()) {
-
 
7001
		C_File *file = node->Data();
-
 
7002
		if ( file->GetFileType() == FILETYPE_TEXT ) {
6998
	if ( iLang == 0 ) iLang = m_iLanguage;
7003
			Utils::String baseFile = CFileIO(file->filePointer()).baseName();
-
 
7004
			int lang = (baseFile.isin("-L")) ? baseFile.right(3) : baseFile.truncate(-4);
-
 
7005
 
6999
 
7006
			// read in the text file to the database
-
 
7007
			text.parseTextFile(17, 17, file->filePointer(), lang);
7000
	Utils::String empWares = this->empWaresForGame();
7008
		}
7001
 
-
 
7002
	for(CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next()) {
-
 
7003
		node->Data()->readWares(iLang, list, empWares);
7009
	}
7004
	}
7010
 
7005
 
7011
	text.setLanguage(44);
7006
	return true;
-
 
7007
}
7012
 
7008
 
7013
	// now go through all emp wares and get the ones we have text for
-
 
7014
	Utils::String empWares = empWaresForGame();
-
 
7015
	int totalWares = 0;
-
 
7016
	Utils::String *wares = empWares.tokenise("\n", &totalWares);
7009
bool CPackages::readCommands(int iLang, CLinkList<SCommandSlot> &list)
7017
	
7010
{
7018
	for(int i = 0; i < totalWares; i++) {
7011
	if ( iLang == 0 ) iLang = m_iLanguage;
-
 
7012
 
7019
		int textId = wares[i].token(";", 7).toLong();
7013
	for(CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next()) {
7020
		if ( text.exists(44, 17, textId) ) {
7014
		node->Data()->readCommands(iLang, list);
7021
			list.pushBack(text.get(44, 17, textId), text.get(44, 17, textId + 1));
-
 
7022
		}
-
 
7023
	}
7015
	}
7024
 
7016
 
-
 
7017
	return true;
-
 
7018
}
-
 
7019
 
-
 
7020
bool CPackages::readWingCommands(int iLang, CLinkList<SCommandSlot> &list)
-
 
7021
{
-
 
7022
	if ( iLang == 0 ) iLang = m_iLanguage;
-
 
7023
 
-
 
7024
	for(CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next()) {
7025
	CLEANSPLIT(wares, totalWares);
7025
		node->Data()->readWingCommands(iLang, list);
-
 
7026
	}
7026
 
7027
 
7027
	return true;
7028
	return true;
7028
}
7029
}
7029
 
7030
 
7030
int CPackages::_warePriceOverride(enum WareTypes type, int pos, const Utils::String &id)
7031
int CPackages::_warePriceOverride(enum WareTypes type, int pos, const Utils::String &id)