Jump to content

a_do_script() return value pass-thru broken since 2.9.15.9408


Recommended Posts

Posted (edited)

DCS 2.9.13.6818 introduced return value pass-thru for a_do_script() and a_do_file():

Quote

Scripting API. Added possibility to pass args and return values from mission scripting a_do_script() and a_do_file() APIs.

This worked up to and including 2.9.14.8394. However, DCS 2.9.15.9408 fixed a segfault within that function:

Quote

Scripting API. net.dostring_in("mission", "a_do_script(...)") causes SEGFAULT with non-scalar return values - fixed. net.dostring_in("mission", "a_do_script(...)") causes SEGFAULT with non-scalar return values - Game Crash - ED Forums

Unfortunately, now the return value pass-thru does not work any more. Presumably a regression introduced by above mentioned fix.

Steps to reproduce:

  1. Run the following code in the hooks (gui) scripting environment, e.g., using my WebConsole.lua:
    return {net.dostring_in("mission", "return a_do_script('return 42')")}
  2. Since 2.9.15.9408, the return value is: ["", true]
    However, the return value should be: ["42", true]

This issue was first reported here by @MarcosR.

P.S.: @ED Please implement proper unit testing in your CI/CD pipeline! The described regression seems like a bug that could have been easily caught by a very simple unit test.

Edited by Actium
  • Like 2
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...