Created
February 22, 2015 08:47
-
-
Save triplefox/3c263d2a11e2deed0445 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luastate.register("matchEntity", proc (state : PState):cint {.cdecl.} = | |
var i1 = (state.tointeger(-1)); state.pop(1) | |
var i0 = (state.tointeger(-1)); state.pop(1) | |
if not game.matchtile: | |
let arch0 = game.entity[game.matcha].d[0] | |
let arch1 = game.entity[game.matchb].d[0] | |
if (arch0 == i0 and arch1 == i1): | |
state.pushboolean(cint(true)) | |
elif (arch0 == i1 and arch1 == i0): | |
swap(game.matcha, game.matchb) | |
state.pushboolean(cint(true)) | |
else: | |
state.pushboolean(cint(false)) | |
else: | |
state.pushboolean(cint(false)) | |
return 1 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment