mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 10:50:24 +00:00
[Titles] Cleanup titles, title suffix, and last name methods. (#2174)
* [Titles] Cleanup titles, title suffix, and last name methods. - Use strings instead of const chars*. - Add optional parameter to SetAATitle in Lua so you can save to the database similar to Perl. - Cleanup #lastname command. - Cleanup #title command. - Cleanup #titlesuffix command. * Update npc.cpp
This commit is contained in:
+13
-11
@@ -2020,20 +2020,22 @@ void Client::Sit() {
|
||||
SetAppearance(eaSitting, false);
|
||||
}
|
||||
|
||||
void Client::ChangeLastName(const char* in_lastname) {
|
||||
void Client::ChangeLastName(std::string last_name) {
|
||||
memset(m_pp.last_name, 0, sizeof(m_pp.last_name));
|
||||
strn0cpy(m_pp.last_name, in_lastname, sizeof(m_pp.last_name));
|
||||
strn0cpy(m_pp.last_name, last_name.c_str(), sizeof(m_pp.last_name));
|
||||
auto outapp = new EQApplicationPacket(OP_GMLastName, sizeof(GMLastName_Struct));
|
||||
GMLastName_Struct* gmn = (GMLastName_Struct*)outapp->pBuffer;
|
||||
strcpy(gmn->name, name);
|
||||
strcpy(gmn->gmname, name);
|
||||
strcpy(gmn->lastname, in_lastname);
|
||||
gmn->unknown[0]=1;
|
||||
gmn->unknown[1]=1;
|
||||
gmn->unknown[2]=1;
|
||||
gmn->unknown[3]=1;
|
||||
auto gmn = (GMLastName_Struct*) outapp->pBuffer;
|
||||
strn0cpy(gmn->name, name, sizeof(gmn->name));
|
||||
strn0cpy(gmn->gmname, name, sizeof(gmn->gmname));
|
||||
strn0cpy(gmn->lastname, last_name.c_str(), sizeof(gmn->lastname));
|
||||
|
||||
gmn->unknown[0] = 1;
|
||||
gmn->unknown[1] = 1;
|
||||
gmn->unknown[2] = 1;
|
||||
gmn->unknown[3] = 1;
|
||||
|
||||
entity_list.QueueClients(this, outapp, false);
|
||||
// Send name update packet here... once know what it is
|
||||
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user