EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Perl Doors Fix -- GetIncline and SetIncline (https://www.eqemulator.org/forums/showthread.php?t=37318)

NatedogEZ 09-25-2013 11:39 PM

Perl Doors Fix -- GetIncline and SetIncline
 
Incline is allowed to be negative and the Perl only allows uint32.

There is a minor typo fix in this as well... the "Usage example" for GetSize ..said "GetIncline" so just changed it.



Code:

@@ -332,7 +332,7 @@
                Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)");
        {
                Doors *                THIS;
-                uint32                RETVAL;
+                int32                    RETVAL;
                dXSTARG;
 
                if (sv_derived_from(ST(0), "Doors")) {
@@ -345,7 +345,7 @@
                        Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
 
                RETVAL = THIS->GetIncline();
-                XSprePUSH; PUSHu((UV)RETVAL);
+                XSprePUSH; PUSHi((IV)RETVAL);
        }
        XSRETURN(1);
 }
@@ -355,7 +355,7 @@
 {
        dXSARGS;
        if (items != 1)
-                Perl_croak(aTHX_ "Usage: Doors::GetIncline(THIS)");
+                Perl_croak(aTHX_ "Usage: Doors::GetSize(THIS)");
        {
                Doors *                THIS;
                uint32                RETVAL;
@@ -482,7 +482,7 @@
                Perl_croak(aTHX_ "Usage: Doors::SetIncline(THIS, type)");
        {
                Doors *                THIS;
-                uint32                type = (uint32)SvUV(ST(1));
+                int32                type = (int32)SvIV(ST(1));
 
                if (sv_derived_from(ST(0), "Doors")) {
                        IV tmp = SvIV((SV*)SvRV(ST(0)));



All times are GMT -4. The time now is 12:02 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.