mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 21:55:42 +12:00
fix riding on horses.
This commit is contained in:
parent
6c01c98a29
commit
c750891bdb
1 changed files with 36 additions and 21 deletions
|
@ -330,23 +330,30 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
direction -= 20;
|
direction -= 20;
|
||||||
moveTwo = true;
|
moveTwo = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ystart = y - 4;
|
int ystart = y - 4;
|
||||||
int xstart = x - 6;
|
int xstart = x - 6;
|
||||||
|
int xend = xstart + 12;
|
||||||
|
int yend = ystart + 9;
|
||||||
|
|
||||||
if (direction == DIRECTION_UP)
|
if (direction == DIRECTION_UP)
|
||||||
{
|
{
|
||||||
int totalY = 0;
|
int totalY = 0;
|
||||||
if (moveTwo)
|
if (moveTwo)
|
||||||
totalY = 1;
|
|
||||||
|
|
||||||
for (int relY = totalY; relY >= 0; relY--)
|
|
||||||
{
|
{
|
||||||
for (int relx = 0; relx <= 12; relx++)
|
ystart++;
|
||||||
|
totalY = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int yy = ystart; yy >= ystart - totalY; yy--)
|
||||||
|
{
|
||||||
|
for (int xx = xstart; xx <= xend; xx++)
|
||||||
{
|
{
|
||||||
int tileId = Map.GetTileId(xstart + relx, ystart + relY, false);
|
int tileId = Map.GetTileId(xx, yy, false);
|
||||||
int otileId = Map.GetTileId(xstart + relx, ystart + relY, true);
|
int otileId = Map.GetTileId(xx, yy, true);
|
||||||
|
|
||||||
if (tileId >= 190)
|
if (tileId >= 190)
|
||||||
{
|
{
|
||||||
|
@ -371,14 +378,17 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
int totalX = 0;
|
int totalX = 0;
|
||||||
if (moveTwo)
|
if (moveTwo)
|
||||||
totalX = 1;
|
|
||||||
|
|
||||||
for (int relX = totalX; relX >= 0; relX--)
|
|
||||||
{
|
{
|
||||||
for (int rely = 0; rely <= 9; rely++)
|
xstart++;
|
||||||
|
totalX = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int xx = xstart; xx >= xstart - totalX; xx--)
|
||||||
|
{
|
||||||
|
for (int yy = ystart; yy <= yend; yy++)
|
||||||
{
|
{
|
||||||
int tileId = Map.GetTileId(xstart + relX, ystart + rely, false);
|
int tileId = Map.GetTileId(xx, yy, false);
|
||||||
int otileId = Map.GetTileId(xstart + relX, ystart + rely, true);
|
int otileId = Map.GetTileId(xx, yy, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -406,15 +416,18 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
int totalX = 0;
|
int totalX = 0;
|
||||||
if (moveTwo)
|
if (moveTwo)
|
||||||
|
{
|
||||||
|
xend--;
|
||||||
totalX = 1;
|
totalX = 1;
|
||||||
|
}
|
||||||
|
|
||||||
for (int relX = 0; relX <= totalX; relX++)
|
for (int xx = xend; xx <= xend + totalX; xx++)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int rely = 0; rely <= 9; rely++)
|
for (int yy = ystart; yy <= yend; yy++)
|
||||||
{
|
{
|
||||||
int tileId = Map.GetTileId(xstart + relX + 12, ystart + rely, false);
|
int tileId = Map.GetTileId(xx, yy, false);
|
||||||
int otileId = Map.GetTileId(xstart + relX + 12, ystart + rely, true);
|
int otileId = Map.GetTileId(xx, yy, true);
|
||||||
|
|
||||||
|
|
||||||
if (tileId >= 190)
|
if (tileId >= 190)
|
||||||
|
@ -439,15 +452,18 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
int totalY = 0;
|
int totalY = 0;
|
||||||
if (moveTwo)
|
if (moveTwo)
|
||||||
|
{
|
||||||
|
yend--;
|
||||||
totalY = 1;
|
totalY = 1;
|
||||||
|
}
|
||||||
|
|
||||||
for (int relY = totalY; relY >= 0; relY--)
|
for (int yy = yend; yy <= yend + totalY; yy++)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int relx = 0; relx <= 12; relx++)
|
for (int xx = xstart; xx <= xend; xx++)
|
||||||
{
|
{
|
||||||
int tileId = Map.GetTileId(xstart + relx, ystart + relY + 9 , false);
|
int tileId = Map.GetTileId(xx, yy, false);
|
||||||
int otileId = Map.GetTileId(xstart + relx, ystart + relY + 9, true);
|
int otileId = Map.GetTileId(xx, yy, true);
|
||||||
|
|
||||||
|
|
||||||
if (tileId >= 190)
|
if (tileId >= 190)
|
||||||
|
@ -502,7 +518,6 @@ namespace HISP.Server
|
||||||
byte[] Packet = ms.ToArray();
|
byte[] Packet = ms.ToArray();
|
||||||
ms.Dispose();
|
ms.Dispose();
|
||||||
|
|
||||||
Logger.DebugPrint(BitConverter.ToString(Packet).Replace("-", " "));
|
|
||||||
return Packet;
|
return Packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue