perl_player_corpse.cpp formatting

This commit is contained in:
Akkadius 2018-07-01 19:36:47 -05:00
parent 2010d1ba83
commit 88ed2e64bb

View File

@ -26,7 +26,9 @@
*/ */
#include "../common/features.h" #include "../common/features.h"
#ifdef EMBPERL_XS_CLASSES #ifdef EMBPERL_XS_CLASSES
#include "../common/global_define.h" #include "../common/global_define.h"
#include "embperl.h" #include "embperl.h"
@ -42,8 +44,7 @@
XS(XS_Corpse_GetCharID); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetCharID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetCharID) XS(XS_Corpse_GetCharID) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetCharID(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetCharID(THIS)");
@ -55,21 +56,20 @@ XS(XS_Corpse_GetCharID)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCharID(); RETVAL = THIS->GetCharID();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetDecayTime); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetDecayTime); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetDecayTime) XS(XS_Corpse_GetDecayTime) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetDecayTime(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetDecayTime(THIS)");
@ -81,21 +81,20 @@ XS(XS_Corpse_GetDecayTime)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetDecayTime(); RETVAL = THIS->GetDecayTime();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_Lock); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_Lock); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_Lock) XS(XS_Corpse_Lock) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::Lock(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::Lock(THIS)");
@ -105,8 +104,7 @@ XS(XS_Corpse_Lock)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -117,8 +115,7 @@ XS(XS_Corpse_Lock)
} }
XS(XS_Corpse_UnLock); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_UnLock); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_UnLock) XS(XS_Corpse_UnLock) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::UnLock(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::UnLock(THIS)");
@ -128,8 +125,7 @@ XS(XS_Corpse_UnLock)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -140,8 +136,7 @@ XS(XS_Corpse_UnLock)
} }
XS(XS_Corpse_IsLocked); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_IsLocked); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_IsLocked) XS(XS_Corpse_IsLocked) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::IsLocked(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::IsLocked(THIS)");
@ -152,8 +147,7 @@ XS(XS_Corpse_IsLocked)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -166,8 +160,7 @@ XS(XS_Corpse_IsLocked)
} }
XS(XS_Corpse_ResetLooter); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_ResetLooter); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_ResetLooter) XS(XS_Corpse_ResetLooter) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::ResetLooter(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::ResetLooter(THIS)");
@ -177,8 +170,7 @@ XS(XS_Corpse_ResetLooter)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -189,8 +181,7 @@ XS(XS_Corpse_ResetLooter)
} }
XS(XS_Corpse_GetDBID); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetDBID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetDBID) XS(XS_Corpse_GetDBID) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetDBID(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetDBID(THIS)");
@ -202,21 +193,20 @@ XS(XS_Corpse_GetDBID)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCorpseDBID(); RETVAL = THIS->GetCorpseDBID();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetOwnerName); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetOwnerName); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetOwnerName) XS(XS_Corpse_GetOwnerName) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetOwnerName(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetOwnerName(THIS)");
@ -228,21 +218,21 @@ XS(XS_Corpse_GetOwnerName)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetOwnerName(); RETVAL = THIS->GetOwnerName();
sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG; sv_setpv(TARG, RETVAL);
XSprePUSH;
PUSHTARG;
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_SetDecayTimer); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_SetDecayTimer); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_SetDecayTimer) XS(XS_Corpse_SetDecayTimer) {
{
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, uint32 decay_time)"); Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, uint32 decay_time)");
@ -253,8 +243,7 @@ XS(XS_Corpse_SetDecayTimer)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -265,8 +254,7 @@ XS(XS_Corpse_SetDecayTimer)
} }
XS(XS_Corpse_IsEmpty); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_IsEmpty); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_IsEmpty) XS(XS_Corpse_IsEmpty) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::IsEmpty(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::IsEmpty(THIS)");
@ -277,8 +265,7 @@ XS(XS_Corpse_IsEmpty)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -291,8 +278,7 @@ XS(XS_Corpse_IsEmpty)
} }
XS(XS_Corpse_AddItem); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_AddItem); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_AddItem) XS(XS_Corpse_AddItem) {
{
dXSARGS; dXSARGS;
if (items < 3 || items > 4) if (items < 3 || items > 4)
Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, uint32 item_id, uint16 charges, [unt16 slot = 0])"); Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, uint32 item_id, uint16 charges, [unt16 slot = 0])");
@ -305,8 +291,7 @@ XS(XS_Corpse_AddItem)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -323,8 +308,7 @@ XS(XS_Corpse_AddItem)
} }
XS(XS_Corpse_GetWornItem); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetWornItem); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetWornItem) XS(XS_Corpse_GetWornItem) {
{
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::GetWornItem(THIS, equipSlot)"); Perl_croak(aTHX_ "Usage: Corpse::GetWornItem(THIS, equipSlot)");
@ -337,21 +321,20 @@ XS(XS_Corpse_GetWornItem)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetWornItem(equipSlot); RETVAL = THIS->GetWornItem(equipSlot);
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_RemoveItem); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_RemoveItem); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_RemoveItem) XS(XS_Corpse_RemoveItem) {
{
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::RemoveItem(THIS, uint16 loot_slot)"); Perl_croak(aTHX_ "Usage: Corpse::RemoveItem(THIS, uint16 loot_slot)");
@ -362,8 +345,7 @@ XS(XS_Corpse_RemoveItem)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -374,8 +356,7 @@ XS(XS_Corpse_RemoveItem)
} }
XS(XS_Corpse_SetCash); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_SetCash); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_SetCash) XS(XS_Corpse_SetCash) {
{
dXSARGS; dXSARGS;
if (items != 5) if (items != 5)
Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)"); Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, uint16 copper, uint16 silver, uint16 gold, uint16 platinum)");
@ -389,8 +370,7 @@ XS(XS_Corpse_SetCash)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -401,8 +381,7 @@ XS(XS_Corpse_SetCash)
} }
XS(XS_Corpse_RemoveCash); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_RemoveCash); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_RemoveCash) XS(XS_Corpse_RemoveCash) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::RemoveCash(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::RemoveCash(THIS)");
@ -412,8 +391,7 @@ XS(XS_Corpse_RemoveCash)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -424,8 +402,7 @@ XS(XS_Corpse_RemoveCash)
} }
XS(XS_Corpse_CountItems); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CountItems); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CountItems) XS(XS_Corpse_CountItems) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::CountItems(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::CountItems(THIS)");
@ -437,21 +414,20 @@ XS(XS_Corpse_CountItems)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->CountItems(); RETVAL = THIS->CountItems();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_Delete); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_Delete); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_Delete) XS(XS_Corpse_Delete) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::Delete(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::Delete(THIS)");
@ -461,8 +437,7 @@ XS(XS_Corpse_Delete)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -473,8 +448,7 @@ XS(XS_Corpse_Delete)
} }
XS(XS_Corpse_GetCopper); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetCopper); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetCopper) XS(XS_Corpse_GetCopper) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetCopper(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetCopper(THIS)");
@ -486,21 +460,20 @@ XS(XS_Corpse_GetCopper)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCopper(); RETVAL = THIS->GetCopper();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetSilver); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetSilver); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetSilver) XS(XS_Corpse_GetSilver) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetSilver(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetSilver(THIS)");
@ -512,21 +485,20 @@ XS(XS_Corpse_GetSilver)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetSilver(); RETVAL = THIS->GetSilver();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetGold); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetGold); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetGold) XS(XS_Corpse_GetGold) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetGold(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetGold(THIS)");
@ -538,21 +510,20 @@ XS(XS_Corpse_GetGold)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetGold(); RETVAL = THIS->GetGold();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetPlatinum); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_GetPlatinum); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetPlatinum) XS(XS_Corpse_GetPlatinum) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetPlatinum(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::GetPlatinum(THIS)");
@ -564,21 +535,20 @@ XS(XS_Corpse_GetPlatinum)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetPlatinum(); RETVAL = THIS->GetPlatinum();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH;
PUSHu((UV) RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_Summon); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_Summon); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_Summon) XS(XS_Corpse_Summon) {
{
dXSARGS; dXSARGS;
if (items != 3) if (items != 3)
Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, Client* client, bool is_spell)"); Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, Client* client, bool is_spell)");
@ -590,8 +560,7 @@ XS(XS_Corpse_Summon)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -599,8 +568,7 @@ XS(XS_Corpse_Summon)
if (sv_derived_from(ST(1), "Client")) { if (sv_derived_from(ST(1), "Client")) {
IV tmp = SvIV((SV *) SvRV(ST(1))); IV tmp = SvIV((SV *) SvRV(ST(1)));
client = INT2PTR(Client *, tmp); client = INT2PTR(Client *, tmp);
} } else
else
Perl_croak(aTHX_ "client is not of type Client"); Perl_croak(aTHX_ "client is not of type Client");
if (client == nullptr) if (client == nullptr)
Perl_croak(aTHX_ "client is nullptr, avoiding crash."); Perl_croak(aTHX_ "client is nullptr, avoiding crash.");
@ -611,8 +579,7 @@ XS(XS_Corpse_Summon)
} }
XS(XS_Corpse_CastRezz); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CastRezz); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CastRezz) XS(XS_Corpse_CastRezz) {
{
dXSARGS; dXSARGS;
if (items != 3) if (items != 3)
Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, uint16 spell_id, [Mob* caster = nullptr])"); Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, uint16 spell_id, [Mob* caster = nullptr])");
@ -624,8 +591,7 @@ XS(XS_Corpse_CastRezz)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -633,8 +599,7 @@ XS(XS_Corpse_CastRezz)
if (sv_derived_from(ST(2), "Mob")) { if (sv_derived_from(ST(2), "Mob")) {
IV tmp = SvIV((SV *) SvRV(ST(2))); IV tmp = SvIV((SV *) SvRV(ST(2)));
Caster = INT2PTR(Mob *, tmp); Caster = INT2PTR(Mob *, tmp);
} } else
else
Perl_croak(aTHX_ "Caster is not of type Mob"); Perl_croak(aTHX_ "Caster is not of type Mob");
if (Caster == nullptr) if (Caster == nullptr)
Perl_croak(aTHX_ "Caster is nullptr, avoiding crash."); Perl_croak(aTHX_ "Caster is nullptr, avoiding crash.");
@ -645,8 +610,7 @@ XS(XS_Corpse_CastRezz)
} }
XS(XS_Corpse_CompleteRezz); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CompleteRezz); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CompleteRezz) XS(XS_Corpse_CompleteRezz) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::CompleteRezz(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::CompleteRezz(THIS)");
@ -656,8 +620,7 @@ XS(XS_Corpse_CompleteRezz)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -668,8 +631,7 @@ XS(XS_Corpse_CompleteRezz)
} }
XS(XS_Corpse_CanMobLoot); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CanMobLoot); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CanMobLoot) XS(XS_Corpse_CanMobLoot) {
{
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, int character_id)"); Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, int character_id)");
@ -681,8 +643,7 @@ XS(XS_Corpse_CanMobLoot)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -695,8 +656,7 @@ XS(XS_Corpse_CanMobLoot)
} }
XS(XS_Corpse_AllowMobLoot); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_AllowMobLoot); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_AllowMobLoot) XS(XS_Corpse_AllowMobLoot) {
{
dXSARGS; dXSARGS;
if (items != 3) if (items != 3)
Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, Mob* them, uint8 slot)"); Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, Mob* them, uint8 slot)");
@ -708,8 +668,7 @@ XS(XS_Corpse_AllowMobLoot)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -717,8 +676,7 @@ XS(XS_Corpse_AllowMobLoot)
if (sv_derived_from(ST(1), "Mob")) { if (sv_derived_from(ST(1), "Mob")) {
IV tmp = SvIV((SV *) SvRV(ST(1))); IV tmp = SvIV((SV *) SvRV(ST(1)));
them = INT2PTR(Mob *, tmp); them = INT2PTR(Mob *, tmp);
} } else
else
Perl_croak(aTHX_ "them is not of type Mob"); Perl_croak(aTHX_ "them is not of type Mob");
if (them == nullptr) if (them == nullptr)
Perl_croak(aTHX_ "them is nullptr, avoiding crash."); Perl_croak(aTHX_ "them is nullptr, avoiding crash.");
@ -729,8 +687,7 @@ XS(XS_Corpse_AllowMobLoot)
} }
XS(XS_Corpse_AddLooter); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_AddLooter); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_AddLooter) XS(XS_Corpse_AddLooter) {
{
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, Mob* who)"); Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, Mob* who)");
@ -741,8 +698,7 @@ XS(XS_Corpse_AddLooter)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -750,8 +706,7 @@ XS(XS_Corpse_AddLooter)
if (sv_derived_from(ST(1), "Mob")) { if (sv_derived_from(ST(1), "Mob")) {
IV tmp = SvIV((SV *) SvRV(ST(1))); IV tmp = SvIV((SV *) SvRV(ST(1)));
who = INT2PTR(Mob *, tmp); who = INT2PTR(Mob *, tmp);
} } else
else
Perl_croak(aTHX_ "who is not of type Mob"); Perl_croak(aTHX_ "who is not of type Mob");
if (who == nullptr) if (who == nullptr)
Perl_croak(aTHX_ "who is nullptr, avoiding crash."); Perl_croak(aTHX_ "who is nullptr, avoiding crash.");
@ -762,8 +717,7 @@ XS(XS_Corpse_AddLooter)
} }
XS(XS_Corpse_IsRezzed); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_IsRezzed); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_IsRezzed) XS(XS_Corpse_IsRezzed) {
{
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::IsRezzed(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::IsRezzed(THIS)");
@ -774,8 +728,7 @@ XS(XS_Corpse_IsRezzed)
if (sv_derived_from(ST(0), "Corpse")) { if (sv_derived_from(ST(0), "Corpse")) {
IV tmp = SvIV((SV *) SvRV(ST(0))); IV tmp = SvIV((SV *) SvRV(ST(0)));
THIS = INT2PTR(Corpse *, tmp); THIS = INT2PTR(Corpse *, tmp);
} } else
else
Perl_croak(aTHX_ "THIS is not of type Corpse"); Perl_croak(aTHX_ "THIS is not of type Corpse");
if (THIS == nullptr) if (THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
@ -791,8 +744,7 @@ XS(XS_Corpse_IsRezzed)
extern "C" extern "C"
#endif #endif
XS(boot_Corpse); /* prototype to pass -Wmissing-prototypes */ XS(boot_Corpse); /* prototype to pass -Wmissing-prototypes */
XS(boot_Corpse) XS(boot_Corpse) {
{
dXSARGS; dXSARGS;
char file[256]; char file[256];
strncpy(file, __FILE__, 256); strncpy(file, __FILE__, 256);