summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-10-13 20:14:17 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-10-13 20:20:11 -0700
commit831243dacc0138c1f5348c9eeed290112ea84dd9 (patch)
tree2bcfb45d23d4abc27f22be5eb6125e4ece4cb675
parentd5cdae1592522e330bac0e197a449d8328c1d5dc (diff)
downloadtmwa-831243dacc0138c1f5348c9eeed290112ea84dd9.tar.gz
tmwa-831243dacc0138c1f5348c9eeed290112ea84dd9.tar.bz2
tmwa-831243dacc0138c1f5348c9eeed290112ea84dd9.tar.xz
tmwa-831243dacc0138c1f5348c9eeed290112ea84dd9.zip
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.
-rw-r--r--src/map/pc.c8
1 files changed, 7 insertions, 1 deletions
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;