Replacing more C-style for loops with the faster, traditional ones. (#62908)

This commit is contained in:
Ghom
2021-11-19 02:39:05 +01:00
committed by GitHub
parent d4f4e05a37
commit 243cd2bfa5
26 changed files with 60 additions and 60 deletions
@@ -34,7 +34,7 @@
/obj/effect/decal/cleanable/xenoblood/xgibs/proc/streak(list/directions, mapload=FALSE)
set waitfor = FALSE
var/direction = pick(directions)
for(var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4, 17; 50), i++) //the 3% chance of 50 steps is intentional and played for laughs.
for(var/i in 1 to pick(1, 200; 2, 150; 3, 50; 4, 17; 50)) //the 3% chance of 50 steps is intentional and played for laughs.
if (!mapload)
sleep(2)
if(i > 0)
@@ -20,7 +20,7 @@
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions, mapload=FALSE)
set waitfor = FALSE
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4, 17; 50), i++) //the 3% chance of 50 steps is intentional and played for laughs.
for (var/i in 1 to pick(1, 200; 2, 150; 3, 50; 4, 17; 50)) //the 3% chance of 50 steps is intentional and played for laughs.
if (!mapload)
sleep(2)
if (i > 0)
@@ -24,7 +24,7 @@
if(frames == 0)
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = alpha / frames
for(var/i = 0, i < frames, i++)
for(var/i in 1 to frames)
alpha -= step
if(alpha < 160)
set_opacity(0) //if we were blocking view, we aren't now because we're fading out
@@ -42,9 +42,9 @@
dna_to_add = list("Non-human DNA" = random_blood_type()) //else, generate a random bloodtype for it.
for(var/i = 1, i<= gibtypes.len, i++)
for(var/i in 1 to gibtypes.len)
if(gibamounts[i])
for(var/j = 1, j<= gibamounts[i], j++)
for(var/j in 1 to gibamounts[i])
var/gibType = gibtypes[i]
gib = new gibType(loc, diseases)