Converts move intents to /decl/move_intent (#8993)

* Converts move intents to /decl/move_intent

Adds /decl/move_intent/walk and /decl/move_intent/run.

Switches all move intent checks to use the new IS_RUNNING and IS_WALKING macros.

Renames and refactors /mob/living/proc/set_m_intent() to /mob/living/proc/set_move_intent(decl/move_intent/intent).

Removes the unnecessary /mob/var/m_int and associated code.

Updates all move intent setters to use set_move_intent().

* Swaps incorrect config values

Swaps incorrect move delays since I got them backwards somehow, oopsies.

* Adds suggested ?. operator

Compactifies two if statements using the ?. operator instead.
This commit is contained in:
Frenjo
2023-03-04 22:28:10 +00:00
committed by GitHub
parent 633e8c6dd8
commit 20cdc4b676
27 changed files with 110 additions and 115 deletions

View File

@@ -85,7 +85,7 @@
if(armed)
if(ishuman(AM))
var/mob/living/carbon/H = AM
if(H.m_intent == "run")
if(IS_RUNNING(H))
triggered(H)
H.visible_message("<span class='warning'>[H] accidentally steps on [src].</span>", \
"<span class='warning'>You accidentally step on [src]</span>")
@@ -120,4 +120,4 @@
return
layer = HIDING_LAYER
to_chat(usr, "<span class='notice'>You hide [src].</span>")
to_chat(usr, "<span class='notice'>You hide [src].</span>")