[Cleanup] Quest API push methods using invalid types. (#2172)

* [Cleanup] Quest API push methods using invalid types.
- Some push methods were pushing integers as unsigned integers or unsigned integer as integers, this fixes all of that.
- Also cleans up some lines that had multiple function calls on them.

* More cleanup of bools and one expansion name was wrong.
This commit is contained in:
Kinglykrab 2022-05-15 22:14:16 -04:00 committed by GitHub
parent 8554aab2ff
commit 7c1a139991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 454 additions and 288 deletions

View File

@ -54,7 +54,7 @@ namespace Expansion {
VeilOfAlaris,
RainOfFear,
CallOfTheForsaken,
TheDarkendSea,
TheDarkenedSea,
TheBrokenMirror,
EmpiresOfKunark,
RingOfScale,
@ -127,7 +127,7 @@ public:
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheDarkenedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkenedSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
@ -155,7 +155,7 @@ public:
bool IsCurrentExpansionVeilOfAlaris() { return current_expansion == Expansion::ExpansionNumber::VeilOfAlaris; }
bool IsCurrentExpansionRainOfFear() { return current_expansion == Expansion::ExpansionNumber::RainOfFear; }
bool IsCurrentExpansionCallOfTheForsaken() { return current_expansion == Expansion::ExpansionNumber::CallOfTheForsaken; }
bool IsCurrentExpansionTheDarkendSea() { return current_expansion == Expansion::ExpansionNumber::TheDarkendSea; }
bool IsCurrentExpansionTheDarkenedSea() { return current_expansion == Expansion::ExpansionNumber::TheDarkenedSea; }
bool IsCurrentExpansionTheBrokenMirror() { return current_expansion == Expansion::ExpansionNumber::TheBrokenMirror; }
bool IsCurrentExpansionEmpiresOfKunark() { return current_expansion == Expansion::ExpansionNumber::EmpiresOfKunark; }
bool IsCurrentExpansionRingOfScale() { return current_expansion == Expansion::ExpansionNumber::RingOfScale; }

View File

@ -58,7 +58,8 @@ XS(XS_EQDB_field_count)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->field_count();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -84,7 +85,8 @@ XS(XS_EQDB_affected_rows)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->affected_rows();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -110,7 +112,8 @@ XS(XS_EQDB_insert_id)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->insert_id();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -136,7 +139,8 @@ XS(XS_EQDB_get_errno)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->get_errno();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}

View File

@ -54,7 +54,8 @@ XS(XS_EQDBRes_num_rows)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->num_rows();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -80,7 +81,8 @@ XS(XS_EQDBRes_num_fields)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->num_fields();
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}

File diff suppressed because it is too large Load Diff

View File

@ -1619,8 +1619,8 @@ bool lua_is_call_of_the_forsaken_enabled() {
return content_service.IsCallOfTheForsakenEnabled();
}
bool lua_is_the_darkend_sea_enabled() {
return content_service.IsTheDarkendSeaEnabled();
bool lua_is_the_darkened_sea_enabled() {
return content_service.IsTheDarkenedSeaEnabled();
}
bool lua_is_the_broken_mirror_enabled() {
@ -1727,8 +1727,8 @@ bool lua_is_current_expansion_call_of_the_forsaken() {
return content_service.IsCurrentExpansionCallOfTheForsaken();
}
bool lua_is_current_expansion_the_darkend_sea() {
return content_service.IsCurrentExpansionTheDarkendSea();
bool lua_is_current_expansion_the_darkened_sea() {
return content_service.IsCurrentExpansionTheDarkenedSea();
}
bool lua_is_current_expansion_the_broken_mirror() {
@ -4078,7 +4078,7 @@ luabind::scope lua_register_general() {
luabind::def("is_veil_of_alaris_enabled", &lua_is_veil_of_alaris_enabled),
luabind::def("is_rain_of_fear_enabled", &lua_is_rain_of_fear_enabled),
luabind::def("is_call_of_the_forsaken_enabled", &lua_is_call_of_the_forsaken_enabled),
luabind::def("is_the_darkend_sea_enabled", &lua_is_the_darkend_sea_enabled),
luabind::def("is_the_darkened_sea_enabled", &lua_is_the_darkened_sea_enabled),
luabind::def("is_the_broken_mirror_enabled", &lua_is_the_broken_mirror_enabled),
luabind::def("is_empires_of_kunark_enabled", &lua_is_empires_of_kunark_enabled),
luabind::def("is_ring_of_scale_enabled", &lua_is_ring_of_scale_enabled),
@ -4105,7 +4105,7 @@ luabind::scope lua_register_general() {
luabind::def("is_current_expansion_veil_of_alaris", &lua_is_current_expansion_veil_of_alaris),
luabind::def("is_current_expansion_rain_of_fear", &lua_is_current_expansion_rain_of_fear),
luabind::def("is_current_expansion_call_of_the_forsaken", &lua_is_current_expansion_call_of_the_forsaken),
luabind::def("is_current_expansion_the_darkend_sea", &lua_is_current_expansion_the_darkend_sea),
luabind::def("is_current_expansion_the_darkened_sea", &lua_is_current_expansion_the_darkened_sea),
luabind::def("is_current_expansion_the_broken_mirror", &lua_is_current_expansion_the_broken_mirror),
luabind::def("is_current_expansion_empires_of_kunark", &lua_is_current_expansion_empires_of_kunark),
luabind::def("is_current_expansion_ring_of_scale", &lua_is_current_expansion_ring_of_scale),

View File

@ -4661,7 +4661,7 @@ XS(XS_Client_GetMoney) {
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetMoney(type, subtype);
XSprePUSH;
PUSHn((uint32) RETVAL);
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -4678,7 +4678,7 @@ XS(XS_Client_GetAccountAge) {
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetAccountAge();
XSprePUSH;
PUSHn((int) RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}

View File

@ -1496,7 +1496,7 @@ XS(XS_NPC_GetScore) {
VALIDATE_THIS_IS_NPC;
RETVAL = THIS->GetScore();
XSprePUSH;
PUSHi((UV) RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}

View File

@ -317,7 +317,8 @@ XS(XS_PerlPacket_GetByte)
uint32 pos = (uint32)SvUV(ST(1));
VALIDATE_THIS_IS_PACKET;
RETVAL = THIS->GetByte(pos);
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -335,7 +336,8 @@ XS(XS_PerlPacket_GetShort)
uint32 pos = (uint32)SvUV(ST(1));
VALIDATE_THIS_IS_PACKET;
RETVAL = THIS->GetShort(pos);
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -353,7 +355,8 @@ XS(XS_PerlPacket_GetLong)
uint32 pos = (uint32)SvUV(ST(1));
VALIDATE_THIS_IS_PACKET;
RETVAL = THIS->GetLong(pos);
XSprePUSH; PUSHu((UV)RETVAL);
XSprePUSH;
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -371,7 +374,8 @@ XS(XS_PerlPacket_GetFloat)
uint32 pos = (uint32)SvUV(ST(1));
VALIDATE_THIS_IS_PACKET;
RETVAL = THIS->GetFloat(pos);
XSprePUSH; PUSHn((double)RETVAL);
XSprePUSH;
PUSHn((double) RETVAL);
}
XSRETURN(1);
}