event based incapicated and able_to_run (#86031)

## About The Pull Request
this is a revival of #82635 . i got permission from potato to reopen
this, he did almost all the work. i only just solved the conflicts and
fixed all the bugs that were preventing the original from being merged
(but it should be TMed first)

## Why It's Good For The Game
slightly improves the performance of basic mob AI

## Changelog
🆑
LemonInTheDark
refactor: able_to_run and incapacitated have been refactored to be event
based
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: ZephyrTFA <matthew@tfaluc.com>
This commit is contained in:
Ben10Omintrix
2024-09-04 10:02:49 -04:00
committed by GitHub
co-authored by LemonInTheDark ZephyrTFA
parent 8fe62dac3d
commit 91baa94ac5
170 changed files with 446 additions and 307 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
if(!ismob(music_player))
return STOP_PLAYING
var/mob/user = music_player
if(user.incapacitated() || !((loc == user) || (isturf(loc) && Adjacent(user)))) // sorry, no more TK playing.
if(user.incapacitated || !((loc == user) || (isturf(loc) && Adjacent(user)))) // sorry, no more TK playing.
return STOP_PLAYING
/obj/item/instrument/suicide_act(mob/living/user)