mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Replaced the critter AI recursion with a proper loop, this seems to have fixed profiling.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
process()
|
||||
set background = 1
|
||||
if (!src.alive) return
|
||||
|
||||
// use a loop to avoid weird benchmarking phenomenons caused by
|
||||
// recursion
|
||||
while(1)
|
||||
switch(task)
|
||||
if("thinking")
|
||||
src.attack = 0
|
||||
@@ -80,9 +84,7 @@
|
||||
icon_state = initial(icon_state)
|
||||
patrol_step()
|
||||
sleep(wanderspeed)
|
||||
spawn(8)
|
||||
process()
|
||||
return
|
||||
sleep(8)
|
||||
|
||||
|
||||
patrol_step()
|
||||
|
||||
Reference in New Issue
Block a user