per chi11ken: adding check for out-of-bounds avatars in POS

afrisby
Brian McBee 2007-11-20 05:59:35 +00:00
parent c8293d908d
commit 5d786056fb
1 changed files with 18 additions and 0 deletions

View File

@ -254,6 +254,24 @@ namespace OpenSim.Region.Physics.POSPlugin
}
}
if (character.Position.Y < 0)
{
character.Position.Y = 0.1F;
}
else if (character.Position.Y >= 256)
{
character.Position.Y = 255.9F;
}
if (character.Position.X < 0)
{
character.Position.X = 0.1F;
}
else if (character.Position.X >= 256)
{
character.Position.X = 255.9F;
}
character._velocity.X = (character.Position.X - oldposX) / timeStep;
character._velocity.Y = (character.Position.Y - oldposY) / timeStep;