I question some people (#28208)

This commit is contained in:
Vi3trice
2025-02-12 13:19:06 +00:00
committed by GitHub
parent 79db47edc6
commit baad3135c9
11 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -63,9 +63,9 @@
#define ISABOUTEQUAL(a, b, deviation) (deviation ? abs((a) - (b)) <= deviation : abs((a) - (b)) <= 0.1)
#define ISEVEN(x) (x % 2 == 0)
#define ISEVEN(x) (!((x) & 1))
#define ISODD(x) (x % 2 != 0)
#define ISODD(x) ((x) & 1)
// Returns true if val is from min to max, inclusive.
#define ISINRANGE(val, min, max) (min <= val && val <= max)
+1 -1
View File
@@ -77,7 +77,7 @@
/proc/ui_hand_position(i)
// values based on old hand ui positions (CENTER:-/+16,SOUTH:5)
var/x_off = i % 2 ? 0 : -1
var/x_off = ISODD(i) ? 0 : -1
var/y_off = round((i-1) / 2)
return"CENTER+[x_off]:16,SOUTH+[y_off]:5"
+1 -1
View File
@@ -293,7 +293,7 @@
return copytext(new_message, 1, length + 1)
if(delta == 1)
return new_message + " "
if(delta % 2)
if(ISODD(delta))
new_message = " " + new_message
delta--
var/spaces = add_lspace("",delta/2-1)
+1 -1
View File
@@ -268,7 +268,7 @@
f = round(f)
f = max(low, f)
f = min(high, f)
if((f % 2) == 0) //Ensure the last digit is an odd number
if(ISEVEN(f)) //Ensure the last digit is an odd number
f += 1
return f
+1 -1
View File
@@ -61,7 +61,7 @@
if(steps >= 6)
steps = 0
if(steps % 2)
if(ISODD(steps))
return
if(steps != 0 && !has_gravity(LM, T)) // don't need to step as often when you hop around
@@ -83,12 +83,12 @@ This spawner places pipe leading up to the interior door, you will need to finis
var/obj/machinery/access_button/the_button = spawn_button(T, is_this_an_interior_airlock ? interior_direction : exterior_direction, is_this_an_interior_airlock)
if(one_door_only == DOOR_NORMAL_PLACEMENT) //We only need one door, we are done
return
if(!(tiles_in_x_direction % 2) && (is_this_an_interior_airlock && north_or_south_interior || !is_this_an_interior_airlock && north_or_south_exterior)) //Handle extra airlock for aesthetics
if(ISEVEN(tiles_in_x_direction) && (is_this_an_interior_airlock && north_or_south_interior || !is_this_an_interior_airlock && north_or_south_exterior)) //Handle extra airlock for aesthetics
A = new door_type(get_step(T, EAST))
handle_door_stuff(A, is_this_an_interior_airlock)
if(one_door_only == DOOR_FLIPPED_PLACEMENT)
the_button.forceMove(get_step(the_button, EAST))
else if(!(tiles_in_y_direction % 2) && (is_this_an_interior_airlock && !north_or_south_interior || !is_this_an_interior_airlock && !north_or_south_exterior)) //Handle extra airlock for aesthetics
else if(ISEVEN(tiles_in_y_direction) && (is_this_an_interior_airlock && !north_or_south_interior || !is_this_an_interior_airlock && !north_or_south_exterior)) //Handle extra airlock for aesthetics
A = new door_type(get_step(T, NORTH))
handle_door_stuff(A, is_this_an_interior_airlock)
if(one_door_only == DOOR_FLIPPED_PLACEMENT)
+2 -2
View File
@@ -293,7 +293,7 @@ GLOBAL_LIST_EMPTY(safes)
for(var/i = 1 to ticks)
dial = WRAP(dial - 1, 0, 100)
var/invalid_turn = current_tumbler_index % 2 == 0 || current_tumbler_index > number_of_tumblers
var/invalid_turn = ISEVEN(current_tumbler_index) || current_tumbler_index > number_of_tumblers
if(invalid_turn) // The moment you turn the wrong way or go too far, the tumblers reset
current_tumbler_index = 1
@@ -313,7 +313,7 @@ GLOBAL_LIST_EMPTY(safes)
for(var/i = 1 to ticks)
dial = WRAP(dial + 1, 0, 100)
var/invalid_turn = current_tumbler_index % 2 != 0 || current_tumbler_index > number_of_tumblers
var/invalid_turn = ISODD(current_tumbler_index) || current_tumbler_index > number_of_tumblers
if(invalid_turn) // The moment you turn the wrong way or go too far, the tumblers reset
current_tumbler_index = 1
@@ -234,7 +234,7 @@ RESTRICT_TYPE(/datum/antagonist/traitor)
if(freq < 1451 || freq > 1459)
freqlist += freq
freq += 2
if((freq % 2) == 0)
if(ISEVEN(freq))
freq += 1
freq = pick(freqlist)
@@ -46,7 +46,7 @@
//Start of a breath chain, calls breathe()
/mob/living/carbon/handle_breathing(times_fired)
if(times_fired % 2 == 1)
if(ISODD(times_fired))
var/datum/milla_safe/carbon_breathe/milla = new()
milla.invoke_async(src)
else
@@ -44,7 +44,7 @@
//Even sphere correction engage
var/offByOneOffset = 1
if(bigZ % 2 == 0)
if(ISEVEN(bigZ))
offByOneOffset = 0
for(var/i = lilZ, i <= bigZ+offByOneOffset, i++)
@@ -104,7 +104,7 @@
if(current_ordering[j] < checked_value)
swap_tally++
return swap_tally % 2 == 0
return ISEVEN(swap_tally)
//swap two tiles in same row
/obj/effect/sliding_puzzle/proc/make_solvable()