05-24-2016, 07:50 AM
This patch intends to add a system to easily allow developers to create dynamic proc calls that need to happen after a given amount of time, the main usecase for this is to get rid of a lot of awful and bad code that heavily relies on spawn() to do it's work.
This patch does NOT refactor the entire codebase to use this new system, but I'm more than willing to provide a patch that refactors all current sleeps into proper call_after calls.
A simple example can be found below, and timer.dm contains basic documentation.
this could easily be replaced with
CODE: https://github.com/DoomStation/doom/comp...formance-3
This patch does NOT refactor the entire codebase to use this new system, but I'm more than willing to provide a patch that refactors all current sleeps into proper call_after calls.
A simple example can be found below, and timer.dm contains basic documentation.
Code:
target.bioHolder.AddEffect("bad_eyesight")
spawn(450)
if (target) target.bioHolder.RemoveEffect("bad_eyesight")
this could easily be replaced with
Code:
target.bioHolder.AddEffect("bad_eyesight")
call_after(target.bioHolder, "RemoveEffect", 450, "bad_eyesight")
CODE: https://github.com/DoomStation/doom/comp...formance-3