[9702] Drop now redundent item_text table.

* In beggining bad news: at 3.3.3 switch has been forgoted item_instance.data field chnage.
  In result items with texts (mail copy in to inventory, some other) lost text content.
* That why in current commit item_text droped without convertion. In result all itesm with texts
  will lost text. Sorry for this as i think small porblem :(
* Now text stored in item itself.
This commit is contained in:
VladimirMangos 2010-04-09 01:50:18 +04:00
parent 53486545b5
commit 24f2d03485
17 changed files with 85 additions and 152 deletions

View file

@ -4564,43 +4564,6 @@ void ObjectMgr::LoadGossipScripts()
// checks are done in LoadGossipMenuItems
}
void ObjectMgr::LoadItemTexts()
{
QueryResult *result = CharacterDatabase.Query("SELECT id, text FROM item_text");
uint32 count = 0;
if( !result )
{
barGoLink bar( 1 );
bar.step();
sLog.outString();
sLog.outString( ">> Loaded %u item pages", count );
return;
}
barGoLink bar( (int)result->GetRowCount() );
Field* fields;
do
{
bar.step();
fields = result->Fetch();
mItemTexts[ fields[0].GetUInt32() ] = fields[1].GetCppString();
++count;
} while ( result->NextRow() );
delete result;
sLog.outString();
sLog.outString( ">> Loaded %u item texts", count );
}
void ObjectMgr::LoadPageTexts()
{
sPageTextStore.Free(); // for reload case
@ -5800,19 +5763,6 @@ void ObjectMgr::SetHighestGuids()
}
}
void ObjectMgr::CreateItemText(uint32 guid, std::string text)
{
// insert new item text to container
mItemTexts[ guid ] = text;
// save new item text
CharacterDatabase.escape_string(text);
std::ostringstream query;
query << "INSERT INTO item_text (id,text) VALUES ( '" << guid << "', '" << text << "')";
CharacterDatabase.Execute(query.str().c_str()); // needs to be run this way, because mail body may be more than 1024 characters
}
uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
{
switch(guidhigh)