mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Adapt setup of linedef type 443 (Call Lua function) to UDMF
This commit is contained in:
parent
c49232c1f1
commit
f0d663ea90
3 changed files with 12 additions and 3 deletions
|
@ -1132,7 +1132,7 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
|
||||||
|
|
||||||
for (hookp = linedefexecutorhooks; hookp; hookp = hookp->next)
|
for (hookp = linedefexecutorhooks; hookp; hookp = hookp->next)
|
||||||
{
|
{
|
||||||
if (strcmp(hookp->s.funcname, line->text))
|
if (strcmp(hookp->s.funcname, line->stringargs[0]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (lua_gettop(gL) == 0)
|
if (lua_gettop(gL) == 0)
|
||||||
|
|
|
@ -2665,6 +2665,15 @@ static void P_ConvertBinaryMap(void)
|
||||||
{
|
{
|
||||||
switch (lines[i].special)
|
switch (lines[i].special)
|
||||||
{
|
{
|
||||||
|
case 443: //Call Lua function
|
||||||
|
if (lines[i].text)
|
||||||
|
{
|
||||||
|
lines[i].stringargs[0] = Z_Malloc(strlen(lines[i].text) + 1, PU_LEVEL, NULL);
|
||||||
|
M_Memcpy(lines[i].stringargs[0], lines[i].text, strlen(lines[i].text) + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in the front texture fields)\n", sizeu1(i));
|
||||||
|
break;
|
||||||
case 700: //Slope front sector floor
|
case 700: //Slope front sector floor
|
||||||
case 701: //Slope front sector ceiling
|
case 701: //Slope front sector ceiling
|
||||||
case 702: //Slope front sector floor and ceiling
|
case 702: //Slope front sector floor and ceiling
|
||||||
|
|
|
@ -3367,10 +3367,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
|
|
||||||
case 443: // Calls a named Lua function
|
case 443: // Calls a named Lua function
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (line->text)
|
if (line->stringargs[0])
|
||||||
LUAh_LinedefExecute(line, mo, callsec);
|
LUAh_LinedefExecute(line, mo, callsec);
|
||||||
else
|
else
|
||||||
CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in the front texture fields)\n", sizeu1(line-lines));
|
CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in arg0str)\n", sizeu1(line-lines));
|
||||||
#else
|
#else
|
||||||
CONS_Alert(CONS_ERROR, "The map is trying to run a Lua script, but this exe was not compiled with Lua support!\n");
|
CONS_Alert(CONS_ERROR, "The map is trying to run a Lua script, but this exe was not compiled with Lua support!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue