new typ(arglist(list(...))) runtimes in the following cases where new typ(...) does not:
- when ... is empty (list index out of bounds)
- when typ is datum-derived and there is no New() defined at any level between it and /datum (inclusive) (illegal use of list2args() or named parameters)
Numbered Steps to Reproduce Problem:
Run following code.
Code Snippet (if applicable) to Reproduce Problem:
#define DEBUG
/datum/with_own_new
New()
..()
/datum/without_new
/proc/a_proc()
/world/New()
a_proc(1, 2, 3) // OK
new /obj(1, 2, 3) // OK
new /datum/with_own_new(1, 2, 3) // OK
new /datum/without_new(1, 2, 3) // OK
var/L = list(1, 2, 3)
a_proc(arglist(L)) // OK
new /obj(arglist(L)) // OK
new /datum/with_own_new(arglist(L)) // OK
new /datum/without_new(arglist(L)) // illegal use of list2args() or named parameters
L = list()
a_proc(arglist(L)) // OK
new /obj(arglist(L)) // list index out of bounds
new /datum/with_own_new(arglist(L)) // list index out of bounds
new /datum/without_new(arglist(L)) // list index out of bounds
Expected Results: No runtimes
Actual Results: Runtimes
Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur? When not using arglist(), or when the list is non-empty and the type has New() defined in the DM code.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unsure.
Workarounds:
None that I know of.