ID:2785246
 
Resolved
Procs used in regex replacements didn't have usr set.
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 100.0.4896.127
Applies to:Dream Daemon
Status: Resolved (514.1584)

This issue has been resolved.
Descriptive Problem Summary:

Procs called by things like regex.Replace() lack a usr, making it a pain in the butt to actually know where the call is coming from.

Numbered Steps to Reproduce Problem:

1) Code below.

Code Snippet (if applicable) to Reproduce Problem:
var/regex/my_regex // Doesn't need valid regex to test.

proc/regexTest(match,group1,group2)
world << "USR: [usr]" // "USR: "

mob/proc/Test(string)
return my_regex.Replace(string, /proc/regexTest)


Expected Results:
usr to exist within the proc like it does in every other case, so we can know where the call is coming from at the very least, or close to it.

Actual Results:
None of the regex callback procs have a usr set.

Does the problem occur:
Every time? Or how often?
In other games?
In other user accounts?
On other computers?

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:

Use a global variable that you set just before you call the proc and hope that nothing manages to set it to something else in the meantime.
Since BYOND is single-threaded, nothing elsewhere could change that global variable unless you sleep() between when it's set and when it's read. It's still an unpleasant workaround, though.
Lummox JR resolved issue with message:
Procs used in regex replacements didn't have usr set.