mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
LunaCON: strip dir prefixes on file-not-found; _getpname, ud.m_player_skill.
git-svn-id: https://svn.eduke32.com/eduke32@3862 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
16b3cb6a42
commit
bd49bc7bbd
4 changed files with 31 additions and 13 deletions
|
@ -841,9 +841,10 @@ local UserdefLabels = {
|
||||||
idplayers = UDRO".idplayers",
|
idplayers = UDRO".idplayers",
|
||||||
level_number = { UD".level_number", UD":set_level_number(%%s)" },
|
level_number = { UD".level_number", UD":set_level_number(%%s)" },
|
||||||
lockout = UDRO".lockout",
|
lockout = UDRO".lockout",
|
||||||
|
m_player_skill = UDRO".m_player_skill",
|
||||||
|
m_volume_number = UDRO".m_volume_number",
|
||||||
pause_on = UDRO".pause_on",
|
pause_on = UDRO".pause_on",
|
||||||
player_skill = UD".player_skill",
|
player_skill = UD".player_skill",
|
||||||
m_volume_number = UDRO".m_volume_number",
|
|
||||||
mouseflip = UDRO".mouseflip",
|
mouseflip = UDRO".mouseflip",
|
||||||
multimode = { "1" },
|
multimode = { "1" },
|
||||||
noexits = UDRO".noexits",
|
noexits = UDRO".noexits",
|
||||||
|
|
|
@ -308,7 +308,7 @@ local int16_st = ffi.typeof "struct { int16_t s; }"
|
||||||
|
|
||||||
function _shoot(i, tilenum, zvel)
|
function _shoot(i, tilenum, zvel)
|
||||||
check_sprite_idx(i)
|
check_sprite_idx(i)
|
||||||
check_sector_idx(sprite[i].sectnum) -- accessed in A_ShootWithZvel
|
check_sector_idx(ffiC.sprite[i].sectnum) -- accessed in A_ShootWithZvel
|
||||||
check_tile_idx(tilenum)
|
check_tile_idx(tilenum)
|
||||||
|
|
||||||
zvel = zvel and int16_st(zvel).s or 0x80000000 -- SHOOT_HARDCODED_ZVEL
|
zvel = zvel and int16_st(zvel).s or 0x80000000 -- SHOOT_HARDCODED_ZVEL
|
||||||
|
@ -768,6 +768,13 @@ function _qgetsysstr(qdst, what, pli)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _getpname(qnum, pli)
|
||||||
|
bcheck.quote_idx(qnum, true)
|
||||||
|
check_player_idx(pli)
|
||||||
|
local uname = ffiC.g_player[pli].user_name
|
||||||
|
ffiC.C_DefineQuote(qnum, (uname[0] ~= 0) and uname or tostring(pli))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- switch statement support
|
-- switch statement support
|
||||||
function _switch(swtab, testval, aci,pli,dist)
|
function _switch(swtab, testval, aci,pli,dist)
|
||||||
|
@ -969,7 +976,8 @@ end
|
||||||
|
|
||||||
-- NOTE: function args of the C function have overloaded meaning
|
-- NOTE: function args of the C function have overloaded meaning
|
||||||
function _A_Spawn(j, pn)
|
function _A_Spawn(j, pn)
|
||||||
local bound_check = sector[sprite[j].sectnum] -- two in one whack
|
check_sprite_idx(j)
|
||||||
|
check_sector_idx(ffiC.sprite[j].sectnum)
|
||||||
check_tile_idx(pn)
|
check_tile_idx(pn)
|
||||||
return CF.A_Spawn(j, pn)
|
return CF.A_Spawn(j, pn)
|
||||||
end
|
end
|
||||||
|
@ -1143,7 +1151,7 @@ function _A_RadiusDamage(i, r, hp1, hp2, hp3, hp4)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _testkey(pli, synckey)
|
function _testkey(pli, synckey)
|
||||||
local bound_check = player[pli]
|
check_player_idx(pli)
|
||||||
if (synckey >= 32ULL) then
|
if (synckey >= 32ULL) then
|
||||||
error("Invalid argument #2 to _testkey: must be in [0..31]", 2)
|
error("Invalid argument #2 to _testkey: must be in [0..31]", 2)
|
||||||
end
|
end
|
||||||
|
|
|
@ -830,18 +830,18 @@ local function do_include_file(dirname, filename, isroot)
|
||||||
local io = require("io")
|
local io = require("io")
|
||||||
|
|
||||||
local fd, msg = io.open(dirname..filename)
|
local fd, msg = io.open(dirname..filename)
|
||||||
if (fd == nil and not isroot) then
|
while (fd == nil and not isroot and filename:find("/")) do
|
||||||
-- strip up to and including first slash:
|
-- strip up to and including first slash:
|
||||||
filename = filename:gsub("^.-/", "")
|
filename = filename:gsub("^.-/", "")
|
||||||
fd, msg = io.open(dirname..filename)
|
fd, msg = io.open(dirname..filename)
|
||||||
|
end
|
||||||
|
|
||||||
-- As a last resort, try the "default directory"
|
-- As a last resort, try the "default directory"
|
||||||
if (fd==nil and g_defaultDir) then
|
if (fd==nil and g_defaultDir) then
|
||||||
-- strip up to and including last slash (if any):
|
-- strip up to and including last slash (if any):
|
||||||
filename = filename:gsub("^.*/", "")
|
filename = filename:gsub("^.*/", "")
|
||||||
dirname = g_defaultDir.."/"
|
dirname = g_defaultDir.."/"
|
||||||
fd, msg = io.open(dirname..filename)
|
fd, msg = io.open(dirname..filename)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if (fd == nil) then
|
if (fd == nil) then
|
||||||
|
@ -2280,7 +2280,9 @@ local Cinner = {
|
||||||
getkeyname = cmd(R,R,R)
|
getkeyname = cmd(R,R,R)
|
||||||
/ "_con._getkeyname(%1,%2,%3)",
|
/ "_con._getkeyname(%1,%2,%3)",
|
||||||
getpname = cmd(R,R) -- THISACTOR
|
getpname = cmd(R,R) -- THISACTOR
|
||||||
/ handle.NYI,
|
/ function(qnum, pli)
|
||||||
|
return format("_con._getpname(%s,%s)", qnum, thisactor_to_pli(pli))
|
||||||
|
end,
|
||||||
|
|
||||||
-- array stuff
|
-- array stuff
|
||||||
-- TODO: handle system gamearrays. Right now, the generated code will be wrong.
|
-- TODO: handle system gamearrays. Right now, the generated code will be wrong.
|
||||||
|
|
|
@ -88,6 +88,13 @@ onevent EVENT_ENTERLEVEL
|
||||||
userquote 400
|
userquote 400
|
||||||
endevent
|
endevent
|
||||||
|
|
||||||
|
// Test of 'getpname' command.
|
||||||
|
onevent EVENT_JUMP
|
||||||
|
getpname 400 THISACTOR
|
||||||
|
userquote 400
|
||||||
|
endevent
|
||||||
|
|
||||||
|
|
||||||
// Following code by Hendricks266, from
|
// Following code by Hendricks266, from
|
||||||
// http://forums.duke4.net/topic/1382-duke-64-mod-thread/page__view__findpost__p__150497
|
// http://forums.duke4.net/topic/1382-duke-64-mod-thread/page__view__findpost__p__150497
|
||||||
gamevar temp 0 0
|
gamevar temp 0 0
|
||||||
|
|
Loading…
Reference in a new issue