Actually the walk through is for walking through users who aren't moving. He's right, this is a "bug" I guess because what it actually is plus emu doesn't actively check if there is a user moving and you are moving through each other to stop both users.I'm confused on what the "bug" is, just looks like you and someone else clicking and going through each other. If you mean how can you make it so you don't go through each other, that's not a bug, it's a room setting, its called user walk through disabled in the settings tab, put the check mark on it.
Is it really a bug though or is it just how the pathfinder works?..Because I've never heard of this "bug," or any complaints about this.Actually the walk through is for walking through users who aren't moving. He's right, this is a "bug" I guess because what it actually is plus emu doesn't actively check if there is a user moving and you are moving through each other to stop both users.
Definitely a bug because if you setup a line (like for falling furni or whatever), people can just ghost through eachother which doesn't seem practical.Is it really a bug though or is it just how the pathfinder works?..Because I've never heard of this "bug," or any complaints about this.
So the way retros Pathfinder work (most, some of the new emulators fix this) is when you click to walk it scans the whole path one time then says you're good to move. It needs to check on every iteration but also needs to be a fast enough check that doesn't cause a stop and go affect.Definitely a bug because if you setup a line (like for falling furni or whatever), people can just ghost through eachother which doesn't seem practical.
But now that i think about it, I think retros might have always been like that. I know real Habbo isn't because i remember entering rooms where the line is full and you have to stay stuck at the room entrance/spawn
How do I solve this, delete this line?Hello guys, i have been searching this bug, i got resolving he. This problem is locate in HabboHotel/Rooms/RoomUserManager.cs, in OnCycle { }.
Modify this codeHow do I solve this, delete this line?
You post on this forum seeking help. Then when you get to a solution, you are now telling other people who are having the same issue to pretty much figure it out? A little hypocritical.Modify this code
Sorry, only replace with this code:You post on this forum seeking help. Then when you get to a solution, you are now telling other people who are having the same issue to pretty much figure it out? A little hypocritical.
Problem was resolved though so maybe the thread should get closed.
public void OnCycle()
{
int userCounter = 0;
try
{
List<RoomUser> ToRemove = new List<RoomUser>();
foreach (RoomUser User in GetUserList().ToList())
{
if (User == null)
continue;
if (!isValid(User))
{
if (User.GetClient() != null)
RemoveUserFromRoom(User.GetClient(), false, false);
else
RemoveRoomUser(User);
}
if (User.NeedsAutokick && !ToRemove.Contains(User))
{
ToRemove.Add(User);
continue;
}
bool updated = false;
User.IdleTime++;
User.HandleSpamTicks();
if (!User.IsBot && !User.IsAsleep && User.IdleTime >= 1200)
{
User.IsAsleep = true;
_room.SendMessage(new SleepComposer(User, true));
}
if (User.CarryItemID > 0)
{
User.CarryTimer--;
if (User.CarryTimer <= 0)
User.CarryItem(0);
}
if (_room.GotFreeze())
_room.GetFreeze().CycleUser(User);
bool InvalidStep = false;
if (User.isRolling)
{
if (User.rollerDelay <= 0)
{
UpdateUserStatus(User, false);
User.isRolling = false;
}
else
User.rollerDelay--;
}
if (User.SetStep)
{
if (this._room.GetGameMap().IsValidWalk(User, new Vector2D(User.X, User.Y), new Vector2D(User.SetX, User.SetY), User.AllowOverride) || User.RidingHorse)
{
if (!User.RidingHorse)
_room.GetGameMap().UpdateUserMovement(new Point(User.Coordinate.X, User.Coordinate.Y), new Point(User.SetX, User.SetY), User);
List<Item> items = _room.GetGameMap().GetCoordinatedItems(new Point(User.X, User.Y));
foreach (Item Item in items.ToList())
{
Item.UserWalksOffFurni(User);
}
if (!User.IsBot)
{
User.X = User.SetX;
User.Y = User.SetY;
User.Z = User.SetZ;
}
else if (User.IsBot && !User.RidingHorse)
{
User.X = User.SetX;
User.Y = User.SetY;
User.Z = User.SetZ;
}
if (!User.IsBot && User.RidingHorse)
{
RoomUser Horse = GetRoomUserByVirtualId(User.HorseID);
if (Horse != null)
{
Horse.X = User.SetX;
Horse.Y = User.SetY;
}
}
if (User.X == _room.GetGameMap().Model.DoorX && User.Y == _room.GetGameMap().Model.DoorY && !ToRemove.Contains(User) && !User.IsBot)
{
ToRemove.Add(User);
continue;
}
List<Item> Items = _room.GetGameMap().GetCoordinatedItems(new Point(User.X, User.Y));
foreach (Item Item in Items.ToList())
{
Item.UserWalksOnFurni(User);
}
UpdateUserStatus(User, true);
}
else
InvalidStep = true;
User.SetStep = false;
}
if (User.IsWalking && !User.Freezed)
{
SquarePoint point = DreamPathfinder.GetNextStep(User, new Vector2D(User.X, User.Y), new Vector2D(User.GoalX, User.GoalY), this._room.GetGameMap());
if (InvalidStep || (point.X == User.X) && (point.Y == User.Y) || (User.GoalX == User.X && User.GoalY == User.Y)) //No path found, or reached goal (:
{
User.IsWalking = false;
User.RemoveStatus("mv");
User.handelingBallStatus = 0;
if (User.Statusses.ContainsKey("sign"))
User.RemoveStatus("sign");
if (User.IsBot && User.BotData.TargetUser > 0)
{
if (User.CarryItemID > 0)
{
RoomUser Target = _room.GetRoomUserManager().GetRoomUserByHabbo(User.BotData.TargetUser);
if (Target != null && Gamemap.TilesTouching(User.X, User.Y, Target.X, Target.Y))
{
User.SetRot(Rotation.Calculate(User.X, User.Y, Target.X, Target.Y), false);
Target.SetRot(Rotation.Calculate(Target.X, Target.Y, User.X, User.Y), false);
Target.CarryItem(User.CarryItemID);
}
}
User.CarryItem(0);
User.BotData.TargetUser = 0;
}
if (User.RidingHorse && User.IsPet == false && !User.IsBot)
{
RoomUser mascotaVinculada = GetRoomUserByVirtualId(User.HorseID);
if (mascotaVinculada != null)
{
mascotaVinculada.IsWalking = false;
mascotaVinculada.RemoveStatus("mv");
mascotaVinculada.UpdateNeeded = true;
}
}
}
else
{
int nextX = point.X;
int nextY = point.Y;
double nextZ = _room.GetGameMap().SqAbsoluteHeight(nextX, nextY);
if (!User.IsBot)
{
if (User.isSitting)
{
User.Statusses.Remove("sit");
User.Z += 0.35;
User.isSitting = false;
User.UpdateNeeded = true;
}
else if (User.isLying)
{
User.Statusses.Remove("sit");
User.Z += 0.35;
User.isLying = false;
User.UpdateNeeded = true;
}
}
if (!User.IsBot)
{
User.Statusses.Remove("lay");
User.Statusses.Remove("sit");
}
if (!User.IsBot && !User.IsPet && User.GetClient() != null)
{
if (User.GetClient().GetHabbo().IsTeleporting)
{
User.GetClient().GetHabbo().IsTeleporting = false;
User.GetClient().GetHabbo().TeleporterId = 0;
}
else if (User.GetClient().GetHabbo().IsHopping)
{
User.GetClient().GetHabbo().IsHopping = false;
User.GetClient().GetHabbo().HopperId = 0;
}
}
if (!User.IsBot && User.RidingHorse && User.IsPet == false)
{
RoomUser Horse = GetRoomUserByVirtualId(User.HorseID);
if (Horse != null)
Horse.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ));
User.AddStatus("mv", +nextX + "," + nextY + "," + TextHandling.GetString(nextZ + 1));
User.UpdateNeeded = true;
Horse.UpdateNeeded = true;
}
else
User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ));
int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled);
User.RotBody = newRot;
User.RotHead = newRot;
User.SetStep = true;
User.SetX = nextX;
User.SetY = nextY;
User.SetZ = nextZ;
UpdateUserEffect(User, User.SetX, User.SetY);
updated = true;
if (User.RidingHorse && User.IsPet == false && !User.IsBot)
{
RoomUser Horse = GetRoomUserByVirtualId(User.HorseID);
if (Horse != null)
{
Horse.RotBody = newRot;
Horse.RotHead = newRot;
Horse.SetStep = true;
Horse.SetX = nextX;
Horse.SetY = nextY;
Horse.SetZ = nextZ;
}
}
_room.GetGameMap().GameMap[User.X, User.Y] = User.SqState; // REstore the old one
User.SqState = _room.GetGameMap().GameMap[User.SetX, User.SetY]; //Backup the new one
if (_room.RoomBlockingEnabled == 0)
{
_room.GetGameMap().GameMap[nextX, nextY] = 0;
}
else
_room.GetGameMap().GameMap[nextX, nextY] = 1;
}
if (!User.RidingHorse)
User.UpdateNeeded = true;
if (_room.GotSoccer())
_room.GetSoccer().OnUserWalk(User);
}
else
{
if (User.Statusses.ContainsKey("mv"))
{
User.RemoveStatus("mv");
User.UpdateNeeded = true;
if (User.RidingHorse)
{
RoomUser Horse = GetRoomUserByVirtualId(User.HorseID);
if (Horse != null)
{
Horse.RemoveStatus("mv");
Horse.UpdateNeeded = true;
}
}
}
}
if (User.RidingHorse)
User.ApplyEffect(77);
if (User.IsBot && User.BotAI != null)
User.BotAI.OnTimerTick();
else
userCounter++;
if (!updated)
{
UpdateUserEffect(User, User.X, User.Y);
}
}
foreach (RoomUser toRemove in ToRemove.ToList())
{
GameClient client = OreoServer.GetGame().GetClientManager().GetClientByUserID(toRemove.HabboId);
if (client != null)
{
RemoveUserFromRoom(client, true, false);
}
else
RemoveRoomUser(toRemove);
}
if (UserCount != userCounter)
UpdateUserCount(userCounter);
}
catch (Exception e)
{
int rId = 0;
if (_room != null)
rId = _room.Id;
Logging.LogCriticalException("Affected Room - ID: " + rId + " - " + e.ToString());
}
}