[FIX][YSI] error 025 - 0.3z RC5
#1

This is what you need to do.

Open:
\pawno\include\YSI\y_als\impl.inc

Find:
pawn Код:
#define ALS_DO_UnoccupiedVehicleUpdate<%0> %0<UnoccupiedVehicleUpdate,iii>(more:vehicleid,more:playerid,end:passenger_seat)
Change to:
pawn Код:
#define ALS_DO_UnoccupiedVehicleUpdate<%0> %0<UnoccupiedVehicleUpdate,iiifff>(more:vehicleid,more:playerid,more:passenger_seat,Float:new_x,Float:new_y,end_Float:new_z)
Save file and close.


Open:
\pawno\include\YSI\y_hooks\impl.inc

Find:
pawn Код:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
    P:2("Hooks_OnUnoccupiedVehicleUpdate called: %d, %d, %d", vehicleid, playerid, passenger_seat);
    new
        end   = _:YSI_g_sCallbackEnd[ALS_OnUnoccupiedVehicleUpdate],
        start = _:YSI_g_sCallbackStart[ALS_OnUnoccupiedVehicleUpdate],
        ret = ALS_R_UnoccupiedVehicleUpdate;
    while (start++ != end)
    {
        #emit PUSH.S passenger_seat
        #emit PUSH.S playerid
        #emit PUSH.S vehicleid
        // I wonder if I could hack the stack with a negative number so that when
        // the called function returns it puts all the header data BACK on to the
        // stack instead of removing the parameters and header.
        #emit PUSH.C     12
        #emit CONST.alt  YSI_g_sCallbackAddresses
        #emit LOAD.S.pri start
        //#emit INC.pri
        //#emit STOR.S.pri start
        #emit LIDX
        #emit MOVE.alt
        #emit LCTRL      6
        #emit ADD.C      24
        #emit PUSH.pri
        #emit MOVE.pri
        #emit SCTRL      6
        #emit MOVE.alt
        #emit CONST.pri  0xFFFFFFFE
        #emit AND
        #emit PUSH.pri
        #emit LOAD.S.pri ret
        #emit AND
        #emit POP.alt
        #emit OR
        #emit STOR.S.pri ret
        if (ret < 0) return ret + 1;
    }
    return ret;
}
Change to:
pawn Код:
public OnUnoccupiedVehicleUpdate(vehicleid,playerid,passenger_seat,Float:new_x,Float:new_y,Float:new_z)
{
    P:2("Hooks_OnUnoccupiedVehicleUpdate called: %d, %d, %d, %f, %f, %f", vehicleid, playerid, passenger_seat, new_x, new_y, new_z);
    new
        end   = _:YSI_g_sCallbackEnd[ALS_OnUnoccupiedVehicleUpdate],
        start = _:YSI_g_sCallbackStart[ALS_OnUnoccupiedVehicleUpdate],
        ret = ALS_R_UnoccupiedVehicleUpdate;
    while (start++ != end)
    {
        #emit PUSH.S new_z
        #emit PUSH.S new_y
        #emit PUSH.S new_x
        #emit PUSH.S passenger_seat
        #emit PUSH.S playerid
        #emit PUSH.S vehicleid
        // I wonder if I could hack the stack with a negative number so that when
        // the called function returns it puts all the header data BACK on to the
        // stack instead of removing the parameters and header.
        #emit PUSH.C     24
        #emit CONST.alt  YSI_g_sCallbackAddresses
        #emit LOAD.S.pri start
        //#emit INC.pri
        //#emit STOR.S.pri start
        #emit LIDX
        #emit MOVE.alt
        #emit LCTRL      6
        #emit ADD.C      24
        #emit PUSH.pri
        #emit MOVE.pri
        #emit SCTRL      6
        #emit MOVE.alt
        #emit CONST.pri  0xFFFFFFFE
        #emit AND
        #emit PUSH.pri
        #emit LOAD.S.pri ret
        #emit AND
        #emit POP.alt
        #emit OR
        #emit STOR.S.pri ret
        if (ret < 0) return ret + 1;
    }
    return ret;
}
Save file and close.

Now compile!
(Sorry for Bad English! :S)
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=488198
EDIT: My bad i didn't notice that this is a fix for UnoccupiedVehicleUpdate
Reply
#3

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=488198
My bad i didn't notice that this is a fix for UnoccupiedVehicleUpdate
This is for "OnUnoccupiedVehicleUpdate" not for "OnPlayerGiveDamage" and "OnPlayerTakeDamage".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)