Skip to content

Commit

Permalink
refactors istype(src) out of make_dizzy()
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdtalon committed Nov 18, 2023
1 parent 71715ee commit 2304860
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1741,3 +1741,9 @@
return FALSE

. = ..()

/mob/living/carbon/human/make_dizzy(amount)
dizziness = min(500, dizziness + amount) // store what will be new value
// clamped to max 500
if(dizziness > 100 && !is_dizzy)
INVOKE_ASYNC(src, PROC_REF(dizzy_process))
11 changes: 2 additions & 9 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,20 +593,13 @@
adds a dizziness amount to a mob
use this rather than directly changing var/dizziness
since this ensures that the dizzy_process proc is started
currently only humans get dizzy
currently only mob/living/carbon/human get dizzy
value of dizziness ranges from 0 to 1000
below 100 is not dizzy
*/
/mob/proc/make_dizzy(amount)
if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy
return

dizziness = min(500, dizziness + amount) // store what will be new value
// clamped to max 500
if(dizziness > 100 && !is_dizzy)
INVOKE_ASYNC(src, PROC_REF(dizzy_process))

return

/*
dizzy process - wiggles the client's pixel offset over time
Expand Down

0 comments on commit 2304860

Please sign in to comment.