Start_Timer(var/mob/M as mob)
for(var/mob/D as mob in world)
if(D.battlefield==M.battlefield)
if(D.timer==0)
D.timer=D.max_time
D.timer-=1
if(D.timer<=0)
D.timer=0
spawn(10)
Start_Timer(M)<dm>
ID:259607
Jan 29 2003, 1:34 pm
|
|
I want to have timer systems for people to know how long til their next upgrade and such, but if there's 20 people logged in with 3 mobs each with timers... would it lag really bad?
|
Probably not. If you're concerned about the lag from searching for mobs in the world, you could do something like this:
var/list/allMobs = list()
mob/player
New()
. = ..()
allMobs += src
Del()
allMobs -= src
. = ..()
...and then just loop through the list. That should take no time at all.