mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 12:28:26 +00:00
[Quest API] Add getcleannpcnamebyid(npc_id) to Perl/Lua. (#1383)
* [Quest API] Add optional clean name parameter to getnpcnamebyid in Perl/Lua. - Allows Server Operators to grab the clean name without having to clean it up in their Perl/Lua. * Convert from a parameter to a method. * Add safer method. * Convert to proper type.
This commit is contained in:
+16
-1
@@ -3026,7 +3026,6 @@ XS(XS__getnpcnamebyid) {
|
||||
dXSTARG;
|
||||
uint32 npc_id = (int) SvIV(ST(0));
|
||||
auto npc_name = quest_manager.getnpcnamebyid(npc_id);
|
||||
|
||||
sv_setpv(TARG, npc_name.c_str());
|
||||
XSprePUSH;
|
||||
PUSHTARG;
|
||||
@@ -6760,6 +6759,21 @@ XS(XS__crosszoneaddldonwinbyexpeditionid) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__getcleannpcnamebyid);
|
||||
XS(XS__getcleannpcnamebyid) {
|
||||
dXSARGS;
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: quest::getcleannpcnamebyid(uint32 npc_id)");
|
||||
|
||||
dXSTARG;
|
||||
uint32 npc_id = (uint32) SvUV(ST(0));
|
||||
auto npc_name = quest_manager.getcleannpcnamebyid(npc_id);
|
||||
sv_setpv(TARG, npc_name.c_str());
|
||||
XSprePUSH;
|
||||
PUSHTARG;
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
This is the callback perl will look for to setup the
|
||||
quest package's XSUBs
|
||||
@@ -6984,6 +6998,7 @@ EXTERN_C XS(boot_quest) {
|
||||
newXS(strcpy(buf, "getaaexpmodifierbycharid"), XS__getaaexpmodifierbycharid, file);
|
||||
newXS(strcpy(buf, "getcharidbyname"), XS__getcharidbyname, file);
|
||||
newXS(strcpy(buf, "getclassname"), XS__getclassname, file);
|
||||
newXS(strcpy(buf, "getcleannpcnamebyid"), XS__getcleannpcnamebyid, file);
|
||||
newXS(strcpy(buf, "gethexcolorcode"), XS__gethexcolorcode, file);
|
||||
newXS(strcpy(buf, "getcurrencyid"), XS__getcurrencyid, file);
|
||||
newXS(strcpy(buf, "getexpmodifierbycharid"), XS__getexpmodifierbycharid, file);
|
||||
|
||||
Reference in New Issue
Block a user