mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +00:00
[Quest API] Add secondstotime(duration) to Perl and Lua. (#1281)
- Add quest::converttime(duration) to Perl. - Add eq.convert_time(duration) to Lua.
This commit is contained in:
@@ -6404,6 +6404,23 @@ XS(XS__createitem) {
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS__secondstotime);
|
||||
XS(XS__secondstotime) {
|
||||
dXSARGS;
|
||||
if (items != 1) {
|
||||
Perl_croak(aTHX_ "Usage: quest::secondstotime(int duration)");
|
||||
}
|
||||
|
||||
dXSTARG;
|
||||
std::string time_string;
|
||||
int duration = (int) SvIV(ST(0));
|
||||
time_string = quest_manager.secondstotime(duration);
|
||||
sv_setpv(TARG, time_string.c_str());
|
||||
XSprePUSH;
|
||||
PUSHTARG;
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
This is the callback perl will look for to setup the
|
||||
quest package's XSUBs
|
||||
@@ -6696,6 +6713,7 @@ EXTERN_C XS(boot_quest) {
|
||||
newXS(strcpy(buf, "say"), XS__say, file);
|
||||
newXS(strcpy(buf, "saylink"), XS__saylink, file);
|
||||
newXS(strcpy(buf, "scribespells"), XS__scribespells, file);
|
||||
newXS(strcpy(buf, "secondstotime"), XS__secondstotime, file);
|
||||
newXS(strcpy(buf, "selfcast"), XS__selfcast, file);
|
||||
newXS(strcpy(buf, "set_proximity"), XS__set_proximity, file);
|
||||
newXS(strcpy(buf, "set_zone_flag"), XS__set_zone_flag, file);
|
||||
|
||||
Reference in New Issue
Block a user