mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +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:
+4
-6
@@ -1625,15 +1625,13 @@ XS(XS_NPC_RemoveDefensiveProc) {
|
||||
XS(XS_NPC_ChangeLastName); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_NPC_ChangeLastName) {
|
||||
dXSARGS;
|
||||
if (items < 1 || items > 2)
|
||||
Perl_croak(aTHX_ "Usage: NPC::ChangeLastName(THIS, string name)"); // @categories Script Utility
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: NPC::ChangeLastName(THIS, string last_name)"); // @categories Script Utility
|
||||
{
|
||||
NPC *THIS;
|
||||
char *name = nullptr;
|
||||
std::string last_name = (std::string) SvPV_nolen(ST(1));
|
||||
VALIDATE_THIS_IS_NPC;
|
||||
if (items > 1) { name = (char *) SvPV_nolen(ST(1)); }
|
||||
|
||||
THIS->ChangeLastName(name);
|
||||
THIS->ChangeLastName(last_name);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user