Posted: Thu Jan 25, 2018 1:55 am Post subject: [ACS] NamedExecute across library boundaries is broken
EDIT (2018-01-25 1:29 UTC): I originally uploaded a wrong test case, sorry; I reauploaded a "fixed" version of the test WAD now.
When ACS_NamedExecute or ACS_NamedExecuteAlways are called from one library to execute a script from another library, and if the name of the library which contains the script to be executed comes after the name of the library doing the call in the LOADACS lump (this defined the load order), the ZD ACS VM will end up executing (what seems to be) a random different script.
In case of the test WAD (see below), "caller" will execute itself which will effectively result in an infinite loop. But this is not always the case; when this hit me in rhinolib, the script executed was a completely unrelated one from a different library.
I tested this in ZDoom 2.8.1 for comparison, and it works as expected there.
ZDaemon version: 1.10b08
Test WAD: acstest-namedacrosslibraries.wad
To trigger the bug: Load test WAD in the client, and execute the following in console: pukename caller
The fix is complete and nothing more needs to be done; I'm just going to leave this bit of information here as a clarification to my original post.
Given what we found out yesterday, i realised that load order did not matter at all. I am attaching a more complete test case which can demonstrate that (in b08).
When you do pukename caller with the 'a' version of the WAD, "dummy" will be logged in the console; when you do the same with the 'b' version of the WAD, it will yield "placeholder"; both are wrong. So the problem is symmetrical and affects all ACS_NamedExecute*() calls; It just masked itself in some cases when I was first poking around, because the correct script happened to be executed in those by pure coincidence.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum