Page 1 of 1

Error setting character titles

Posted: Fri Aug 12, 2011 8:05 am
by John Adams
Zcoretri,

There's an error in the world log when a player loads their character. Seems the old field names are still in place for setting character titles. I didn't want to fix this without showing you, since you may just have uncommitted changes still checked out.

Error:
03:22 E DBCore: #1054: Unknown column 'prefix_title' in 'field list'

Cause (in client.cpp, SendCharInfo()):

Code: Select all

database.SetCharacterTitles(this);

Function:

Code: Select all

void WorldDatabase::SetCharacterTitles(Client* client){
	if(!client)
		return;
	Query query;
	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT prefix_title, suffix_title, sub_title FROM character_titles where char_id=%i", client->GetCharacterID());
	if(result && mysql_num_rows(result) > 0) {
		MYSQL_ROW row;
		row = mysql_fetch_row(result);
		strcpy(client->GetPlayer()->appearance.prefix_title, row[0]);
		strcpy(client->GetPlayer()->appearance.suffix_title, row[1]);
		strcpy(client->GetPlayer()->appearance.sub_title, row[2]);
	}
}
Is this an obsolete function? Maybe we just need to remove it.

Re: Error setting character titles

Posted: Fri Aug 12, 2011 9:45 am
by Zcoretri
Yes that is an obsolete function. I did not know that was there :shock:

But I saw the same error popping up in console and fixed it the other day, but have not committed it yet because of your post that said not to commit :mrgreen:

Re: Error setting character titles

Posted: Fri Aug 12, 2011 9:46 am
by John Adams
You should be safe to commit for now. Just do an Update to your local workspace so you can see all the conflicts I created :)

Sorry, meant to say that commit is cool. go for it.