[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

@ -3810,7 +3810,7 @@ XS(XS_Client_GetSpellIDByBookSlot) {
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetSpellIDByBookSlot(slot_id);
XSprePUSH;
PUSHi((IV)RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}
@ -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);
}
@ -4773,7 +4773,7 @@ XS(XS_Client_GetClientMaxLevel) {
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetClientMaxLevel();
XSprePUSH;
PUSHu((UV)RETVAL);
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -6019,7 +6019,7 @@ XS(XS_Client_GetEnvironmentDamageModifier) {
VALIDATE_THIS_IS_CLIENT;
RETVAL = THIS->GetEnvironmentDamageModifier();
XSprePUSH;
PUSHi((IV)RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}
@ -6156,7 +6156,7 @@ XS(XS_Client_CountAugmentEquippedByID) {
VALIDATE_THIS_IS_CLIENT;
quantity = THIS->GetInv().CountAugmentEquippedByID(item_id);
XSprePUSH;
PUSHi((IV)quantity);
PUSHi((IV) quantity);
}
XSRETURN(1);
}
@ -6228,7 +6228,7 @@ XS(XS_Client_CountItemEquippedByID) {
VALIDATE_THIS_IS_CLIENT;
quantity = THIS->GetInv().CountItemEquippedByID(item_id);
XSprePUSH;
PUSHi((IV)quantity);
PUSHi((IV) quantity);
}
XSRETURN(1);
}

View File

@ -126,7 +126,7 @@ XS(XS_Inventory_GetBagIndex) {
VALIDATE_THIS_IS_INVENTORY;
bag_index = THIS->CalcBagIdx(slot_id);
XSprePUSH;
PUSHu((UV)bag_index);
PUSHu((UV) bag_index);
}
XSRETURN(1);
}
@ -162,7 +162,7 @@ XS(XS_Inventory_GetMaterialFromSlot) {
VALIDATE_THIS_IS_INVENTORY;
material = THIS->CalcMaterialFromSlot(slot_id);
XSprePUSH;
PUSHu((UV)material);
PUSHu((UV) material);
}
XSRETURN(1);
}
@ -180,7 +180,7 @@ XS(XS_Inventory_GetSlotByItemInst) {
VALIDATE_THIS_IS_INVENTORY;
slot_id = THIS->GetSlotByItemInst(item);
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -198,7 +198,7 @@ XS(XS_Inventory_GetSlotFromMaterial) {
VALIDATE_THIS_IS_INVENTORY;
slot_id = THIS->CalcSlotFromMaterial(material);
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -222,7 +222,7 @@ XS(XS_Inventory_GetSlotID) {
}
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -247,7 +247,7 @@ XS(XS_Inventory_HasItem) {
slot_id = THIS->HasItem(item_id, quantity, where_to_look);
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -269,7 +269,7 @@ XS(XS_Inventory_HasItemByLoreGroup) {
slot_id = THIS->HasItemByLoreGroup(loregroup, where_to_look);
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -292,7 +292,7 @@ XS(XS_Inventory_HasItemByUse) {
slot_id = THIS->HasItemByUse(item_use, quantity, where_to_look);
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -387,7 +387,7 @@ XS(XS_Inventory_PushCursor) {
slot_id = 0;
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -409,7 +409,7 @@ XS(XS_Inventory_PutItem) {
slot_id = 0;
XSprePUSH;
PUSHi((IV)slot_id);
PUSHi((IV) slot_id);
}
XSRETURN(1);
}
@ -444,7 +444,7 @@ XS(XS_Inventory_CountAugmentEquippedByID) {
VALIDATE_THIS_IS_INVENTORY;
quantity = THIS->CountAugmentEquippedByID(item_id);
XSprePUSH;
PUSHi((IV)quantity);
PUSHi((IV) quantity);
}
XSRETURN(1);
}
@ -479,7 +479,7 @@ XS(XS_Inventory_CountItemEquippedByID) {
VALIDATE_THIS_IS_INVENTORY;
quantity = THIS->CountItemEquippedByID(item_id);
XSprePUSH;
PUSHi((IV)quantity);
PUSHi((IV) quantity);
}
XSRETURN(1);
}

View File

@ -5677,7 +5677,7 @@ XS(XS_Mob_GetBuffStatValueBySpell) {
RETVAL = THIS->GetBuffStatValueBySpell(spellid, stat);
XSprePUSH;
PUSHi((IV)RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}
@ -5697,7 +5697,7 @@ XS(XS_Mob_GetBuffStatValueBySlot) {
RETVAL = THIS->GetBuffStatValueBySlot(slot, stat);
XSprePUSH;
PUSHi((IV)RETVAL);
PUSHi((IV) RETVAL);
}
XSRETURN(1);
}
@ -5858,7 +5858,7 @@ XS(XS_Mob_GetInvisibleLevel) {
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetInvisibleLevel();
XSprePUSH;
PUSHu((UV)RETVAL);
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -5875,7 +5875,7 @@ XS(XS_Mob_GetInvisibleUndeadLevel) {
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->GetInvisibleUndeadLevel();
XSprePUSH;
PUSHu((UV)RETVAL);
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}
@ -5910,7 +5910,7 @@ XS(XS_Mob_SeeInvisibleUndead) {
VALIDATE_THIS_IS_MOB;
RETVAL = THIS->SeeInvisibleUndead();
XSprePUSH;
PUSHu((UV)RETVAL);
PUSHu((UV) RETVAL);
}
XSRETURN(1);
}

View File

@ -1282,7 +1282,7 @@ XS(XS_NPC_GetNPCStat) {
RETVAL = THIS->GetNPCStat(identifier);
XSprePUSH;
PUSHn((double)RETVAL);
PUSHn((double) RETVAL);
}
XSRETURN(1);
}
@ -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);
}