Make unafk instantly when your own rotation changes.

This commit is contained in:
UnknownShadow200 2016-06-03 16:27:25 +10:00
parent 9136e2f39d
commit 14651c1e68
2 changed files with 7 additions and 1 deletions

View File

@ -45,6 +45,7 @@ namespace MCGalaxy.Commands {
p.IsAfk = !p.IsAfk;
p.afkMessage = p.IsAfk ? message : null;
TabList.Update(p, true);
p.LastAction = DateTime.UtcNow;
bool send = !Server.chatmod && !p.muted;
if (p.IsAfk) {

View File

@ -755,9 +755,14 @@ return;
if (cancelmove) {
SendPos(0xFF, pos[0], pos[1], pos[2], rot[0], rot[1]); return;
}
}
pos = new ushort[3] { x, y, z };
rot = new byte[2] { rotx, roty };
if (!Moved()) return;
LastAction = DateTime.UtcNow;
if (IsAfk) CmdAfk.ToggleAfk(this, "");
/*if (!CheckIfInsideBlock()) { clippos = pos; cliprot = rot; }*/
}