SpacemanDMM icon indicating copy to clipboard operation
SpacemanDMM copied to clipboard

Missed sleep with SHOULD_NOT_SLEEP

Open Cyberboss opened this issue 1 year ago • 1 comments

This errors in dreamchecker as expected

/datum/proc/is_valid(value)
    SHOULD_NOT_SLEEP(TRUE)

/datum/choiced/is_valid(value)
    get_choices()

/datum/choiced/proc/get_choices()
    init_possible_values()

/datum/choiced/proc/init_possible_values()

/datum/choiced/ai_core_display/init_possible_values()
    sleep(1)

This doesn't

/datum/proc/is_valid(value)
    SHOULD_NOT_SLEEP(TRUE)

/datum/choiced/is_valid(value)
    get_choices()

/datum/choiced/proc/get_choices()
    init_possible_values()

/datum/choiced/proc/init_possible_values()

/datum/choiced/ai_core_display/init_possible_values()
    stoplag()

/proc/stoplag()
    sleep(1)

Cyberboss avatar May 06 '23 13:05 Cyberboss

As MSO put it: If a proc has SHOULD_NOT_SLEEP on the definition and has an override, sleeps are only detected directly in the override and not the procs it calls.

Cyberboss avatar May 07 '23 15:05 Cyberboss