Add a couple of test CONs: non-local control flow, rotation-fixed useractors.

git-svn-id: https://svn.eduke32.com/eduke32@3317 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-12-23 19:24:25 +00:00
parent 6a4add81bd
commit 596b83aec1
5 changed files with 55 additions and 1 deletions

View file

@ -182,6 +182,7 @@ labels =
SFLAG_NOTELEPORT = 0x00004000,
-- SFLAG_BADGUYSTAYPUT = 0x00008000,
-- SFLAG_CACHE = 0x00010000,
-- SFLAG_ROTFIXED = 0x00020000,
},
{

View file

@ -743,7 +743,7 @@ end
local Ci = {
-- these can appear anywhere in the script
["break"] = cmd()
/ "do return end", -- TODO: more exact semantics
/ "do return end",
["return"] = cmd() -- NLCF
/ "_con.longjmp()", -- TODO: test with code from Wiki "return" entry

View file

@ -0,0 +1,22 @@
state teststate_break
ifvare 1 1
{
redefinequote 114 BEFORE
echo 114
break
redefinequote 114 AFTER
echo 114
}
redefinequote 114 STILL LIVE INNER
echo 114
ends
onevent EVENT_INIT
state teststate_break
redefinequote 114 STILL LIVE OUTER
echo 114
endevent

View file

@ -0,0 +1,25 @@
definequote 125 SPAWNED HEAVYHBOMB
definequote 126 RAN EVENT_EGS
definequote 127 RAN TEST STATE
state teststate1
return
userquote 127
ends
onevent EVENT_EGS
ifactor HEAVYHBOMB
{
state teststate1 // after teststate1's return, return from EVENT_EGS!
userquote 126
}
endevent
onevent EVENT_LOADACTOR
ifvarvare THISACTOR 0
{
// the concrete actor is irrelevant, only placeholder
spawn HEAVYHBOMB // --> EVENT_EGS
userquote 125
}
endevent

View file

@ -0,0 +1,6 @@
useractor 4 58 1 NO NO 0
// usertype 4 is "rotation-fixed actor"
// tile 58 is the space suit
state killme
enda