mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-14 12:12:37 +00:00
Fix loop and control flow syntax
This commit is contained in:
@@ -104,7 +104,7 @@
|
|||||||
|
|
||||||
if("corrupted") // Load them up with ion laws.
|
if("corrupted") // Load them up with ion laws.
|
||||||
var/datum/ai_laws/laws = new() // Start with an empty lawset.
|
var/datum/ai_laws/laws = new() // Start with an empty lawset.
|
||||||
for(1 to rand(1, 3))
|
for(var/i in 1 to rand(1, 3))
|
||||||
laws.add_ion_law(generate_ion_law(exclude_crew_names = TRUE))
|
laws.add_ion_law(generate_ion_law(exclude_crew_names = TRUE))
|
||||||
return laws
|
return laws
|
||||||
|
|
||||||
|
|||||||
@@ -1184,7 +1184,7 @@
|
|||||||
// defines a state machine, returns the new state
|
// defines a state machine, returns the new state
|
||||||
obj/machinery/power/apc/proc/autoset(var/cur_state, var/on)
|
obj/machinery/power/apc/proc/autoset(var/cur_state, var/on)
|
||||||
switch(cur_state)
|
switch(cur_state)
|
||||||
if(POWERCHAN_OFF); //autoset will never turn on a channel set to off
|
//if(POWERCHAN_OFF); //autoset will never turn on a channel set to off
|
||||||
if(POWERCHAN_OFF_AUTO)
|
if(POWERCHAN_OFF_AUTO)
|
||||||
if(on == 1)
|
if(on == 1)
|
||||||
return POWERCHAN_ON_AUTO
|
return POWERCHAN_ON_AUTO
|
||||||
|
|||||||
@@ -185,7 +185,7 @@
|
|||||||
opr=new
|
opr=new
|
||||||
val=new
|
val=new
|
||||||
src.expecting=VALUE
|
src.expecting=VALUE
|
||||||
for()
|
while(TRUE)
|
||||||
if(EndOfExpression(end))
|
if(EndOfExpression(end))
|
||||||
break
|
break
|
||||||
if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value))
|
if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value))
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
NextToken() //skip open parenthesis, already found
|
NextToken() //skip open parenthesis, already found
|
||||||
var/loops = 0
|
var/loops = 0
|
||||||
|
|
||||||
for()
|
while(TRUE)
|
||||||
loops++
|
loops++
|
||||||
if(loops>=1000)
|
if(loops>=1000)
|
||||||
CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;")
|
CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;")
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ var/const/Represents a special statement in the code triggered by a keyword.
|
|||||||
parser.NextToken()
|
parser.NextToken()
|
||||||
if(!parser.CheckToken("(", /token/symbol))
|
if(!parser.CheckToken("(", /token/symbol))
|
||||||
return KW_FAIL
|
return KW_FAIL
|
||||||
for() //for now parameters can be separated by whitespace - they don't need a comma in between
|
while(TRUE) //for now parameters can be separated by whitespace - they don't need a comma in between
|
||||||
if(istype(parser.curToken, /token/symbol))
|
if(istype(parser.curToken, /token/symbol))
|
||||||
switch(parser.curToken.value)
|
switch(parser.curToken.value)
|
||||||
if(",")
|
if(",")
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis
|
if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis
|
||||||
return
|
return
|
||||||
var/loops = 0
|
var/loops = 0
|
||||||
for()
|
while(TRUE)
|
||||||
loops++
|
loops++
|
||||||
if(loops>=6000)
|
if(loops>=6000)
|
||||||
CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;")
|
CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;")
|
||||||
|
|||||||
Reference in New Issue
Block a user