not 'lazy' enough; safer now

This commit is contained in:
WoolyAypa
2022-12-13 18:25:48 -03:00
parent fe8e23f406
commit 4eb101982f
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
// Please tell me if there already is a macro for that
#define LAZYFIRST(L) L[1]
#define LAZYLAST(L) L[length(L)]
#define LISTFIRST(L) (length(L) ? L[1] : null)
#define LISTLAST(L) (length(L) ? L[length(L)] : null)
@@ -123,15 +123,15 @@
/obj/item/chastity_hypno/proc/change_mode(genital, direction)
switch(direction)
if("left")
if(choices[genital] == LAZYFIRST(available_modes))
if(choices[genital] == LISTFIRST(available_modes))
//choices[genital] = available_modes[length(available_modes)]
choices[genital] = LAZYLAST(available_modes)
choices[genital] = LISTLAST(available_modes)
else
choices[genital] = available_modes[LAZYFIND(available_modes, choices[genital]) - 1]
if("right")
if(choices[genital] == LAZYLAST(available_modes))
if(choices[genital] == LISTLAST(available_modes))
//choices[genital] = available_modes[1]
choices[genital] = LAZYFIRST(available_modes)
choices[genital] = LISTFIRST(available_modes)
else
choices[genital] = available_modes[LAZYFIND(available_modes, choices[genital]) + 1]