Add gettaskname(task_id) to Perl/Lua.

This commit is contained in:
Alex
2020-03-31 22:24:09 -04:00
parent 963735e7dd
commit 4712b56078
6 changed files with 46 additions and 0 deletions
+18
View File
@@ -2629,6 +2629,23 @@ XS(XS__istaskappropriate) {
XSRETURN(1);
}
XS(XS__gettaskname);
XS(XS__gettaskname) {
dXSARGS;
if (items != 1) {
Perl_croak(aTHX_ "Usage: quest::gettaskname(uint32 task_id)");
}
dXSTARG;
uint32 task_id = (int) SvIV(ST(0));
std::string task_name = quest_manager.gettaskname(task_id);
sv_setpv(TARG, task_name.c_str());
XSprePUSH;
PUSHTARG;
XSRETURN(1);
}
XS(XS__popup); // prototype to pass -Wmissing-prototypes
XS(XS__popup) {
dXSARGS;
@@ -4050,6 +4067,7 @@ EXTERN_C XS(boot_quest) {
newXS(strcpy(buf, "getplayercorpsecount"), XS__getplayercorpsecount, file);
newXS(strcpy(buf, "getplayercorpsecountbyzoneid"), XS__getplayercorpsecountbyzoneid, file);
newXS(strcpy(buf, "gettaskactivitydonecount"), XS__gettaskactivitydonecount, file);
newXS(strcpy(buf, "gettaskname"), XS__gettaskname, file);
newXS(strcpy(buf, "givecash"), XS__givecash, file);
newXS(strcpy(buf, "gmmove"), XS__gmmove, file);
newXS(strcpy(buf, "gmsay"), XS__gmsay, file);