SpaceManiac / SpacemanDMM

A BYOND language smartness provider, map renderer, and more.
https://marketplace.visualstudio.com/items?itemName=platymuus.dm-langclient
GNU General Public License v3.0
83 stars 83 forks source link

Missed sleep with SHOULD_NOT_SLEEP #355

Open Cyberboss opened 1 year ago

Cyberboss commented 1 year ago

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 commented 1 year ago

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.