Skip to content

Commit

Permalink
Finalize 2.1 source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrapivin committed Mar 27, 2021
1 parent f62d78f commit 673d4c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 deletions.
2 changes: 2 additions & 0 deletions libLassebq/GMAddresses.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define Variable_Addr (0x01A36CC0u)
#define GMLScript_Addr (0x01A3B680u)
#define Run_Room_Addr (0x01CF7868u)
#define CInstanceHash_Addr (0x01A48A88u)
#define Global_YYObject_Addr (0x01ADD168u)
#define Object_Hash_Addr (0x01AE662Cu)
#define GetCtxStackTop_Addr (0x014D4700u)
Expand Down Expand Up @@ -77,6 +78,7 @@
#define Variable_Addr (0x02979E98u)
#define GMLScript_Addr (0x02982D68u)
#define Run_Room_Addr (0x02C46960u)
#define CInstanceHash_Addr (0x029914D8u)
#define Global_YYObject_Addr (0x02A2ADE8u)
#define Object_Hash_Addr (0x02A356ECu)
#define GetCtxStackTop_Addr (0x0236A510u)
Expand Down
37 changes: 3 additions & 34 deletions libLassebq/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

local obj_libLassebq = { }
local player_hurt = { }
local generate_hash = { }

function getDateTime() -- a helper to get formatted datetime from GM
return GML_date_datetime_string(GML_date_current_datetime())
Expand All @@ -10,44 +11,12 @@ end
function obj_libLassebq.PressF5(_pSelf, _pOther)
GML_game_save("temp00")
GML_window_set_caption("Saved, time: " .. getDateTime())
local x = GMLua_inst(_pSelf.id)
end

function obj_libLassebq.PressF6(_pSelf, _pOther)
GML_game_load("temp00")
GML_window_set_caption("Loaded, time: " .. getDateTime())
end

--[[
hooker routine:
if Before defined then
r = call Before
if Before returned
return r
else
r = call Original script
if After defined
r = call After and provide Original r
return r
end
end
end
so by returning from Before, we prevent the original script from executing!
]]--

function player_hurt.Before(_pSelf, _pOther, _args)
--[[ You can't die, you can't die, you can't die, you can't die, you can't die
that would suck, right? sometimes you just *have* to die, your life's over
but no, you are still alive, watching how your close relatives and friends die
pretty painful, ain't it?
welp, I don't have any IRL friends, so not really a problem for me.
UHHHHHHHHHHHHHHHH NEVERMIND I'VE GONE TOO FAR.
oh, btw, `_args` is an array with the arguments. ]]--
return 0 -- ????????
end

function player_hurt.After(_pSelf, _pOther, _args, _ret)
return _ret -- this won't be executed anyway, you don't even need to return
end

return { obj_libLassebq=obj_libLassebq, player_hurt=player_hurt }
return { obj_libLassebq=obj_libLassebq }

0 comments on commit 673d4c7

Please sign in to comment.