From 831243dacc0138c1f5348c9eeed290112ea84dd9 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 13 Oct 2011 20:14:17 -0700 Subject: Workaround for the ancient-but-rare bug that stops people from using magic when the tick wraps. The problem was rare to start with, and would *eventually* go away if you remained logged out, but this allows you to simply log in and log out to fix it. --- src/map/pc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index b76116b..d05ca27 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -819,7 +819,10 @@ int pc_authok (int id, int login_id2, time_t connect_until_time, sd->canmove_tick = tick; sd->attackabletime = tick; /* We don't want players bypassing spell restrictions. [remoitnane] */ - sd->cast_tick = tick + pc_readglobalreg (sd, "MAGIC_CAST_TICK"); + // Removed because it was buggy with the ~50 day wraparound, + // and there's already a limit on how fast you can log in and log out. + // -o11c + sd->cast_tick = tick; // + pc_readglobalreg (sd, "MAGIC_CAST_TICK"); sd->doridori_counter = 0; @@ -9014,12 +9017,15 @@ int pc_logout (struct map_session_data *sd) // [fate] Player logs out * Trying to rapidly sign out/in or switch characters to avoid a spell's * cast time is also bad. [remoitnane] */ +#if 0 + // Removed because it's buggy, see above. if (sd->cast_tick > tick) { if (pc_setglobalreg (sd, "MAGIC_CAST_TICK", sd->cast_tick - tick)) sd->status.sp = 1; } else +#endif pc_setglobalreg (sd, "MAGIC_CAST_TICK", 0); MAP_LOG_STATS (sd, "LOGOUT") return 0; -- cgit v1.2.3-60-g2f50