Code:
// When i don't Host Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
----------------------------------- --------- --------- --------- ---------
/client/Move 0.000 0.000 0.000 285
/client/West 0.000 0.000 0.000 110
/client/East 0.000 0.000 0.000 96
/client/North 0.000 0.000 0.000 44
/client/South 0.000 0.000 0.000 35
Code:
//When i Host the game Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------- --------- --------- --------- ---------
/client/North 0.002 0.004 0.004 83
/client/Move 0.002 0.002 0.002 83
/atom/Click 0.000 0.000 0.000 1
/mob/verb/Run 0.000 0.000 0.000 1
you can see the difference when i host the game i only move 83 time and the cpu and real time increase.. and when i dont host it i move 285 time and the real time and cpu did not increase. do you guy have i idea what can cause that lag??
this is the move code itself
Code:
Move(Loc)
var/GAME_MOB/M = mob
if(mob.isLoginMob)
return 0
if(mob.moving == TRUE || M.dead || M.defending || M.shop_open || M.using_jutsu != null || M.in_bind || M.charging == TRUE || M.casting_shadow == TRUE || M.CantMove == TRUE)
return 0
mob.moving = TRUE
if(M.swimming)
M.running = FALSE
M.step_size = 12
// mob.ActivateAI()
// CHECK_TICK()
// spawn(world.tick_lag)mob.moving = FALSE
spawn(0)mob.moving = FALSE
return ..()