Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Bug Fix] Slide Errors


Recommended Posts

**Sorry my english**

There are two errors, the first error happens when you put a slide:

![](http://img683.imageshack.us/img683/1885/imagemzg.png)

And in front of the slide has lock or resource, and the collides player toward these. The second error is that the player does not slide to the direction chosen in the editor, this tutorial will teach correct both errors occurring on the server.

**Open Server**

1 - In **modPlayer**, look for:

```
' Slide

If .Type = TILE_TYPE_SLIDE Then

ForcePlayerMove Index, MOVING_WALKING, GetPlayerDir(Index)

Moved = YES

End If

End With
```

2 - Replace with:

```
' Slide

If .Type = TILE_TYPE_SLIDE Then

Select Case .Data1

Case DIR_UP

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) - 1).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_LEFT

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) - 1, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_DOWN

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index) + 1).Type = TILE_TYPE_BLOCKED Then Exit Sub

Case DIR_RIGHT

If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_RESOURCE Or Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index) + 1, GetPlayerY(Index)).Type = TILE_TYPE_BLOCKED Then Exit Sub

End Select

ForcePlayerMove Index, MOVING_WALKING, .Data1

Moved = YES

End If

End With
```

**Credits**

Valentine

Ricardo/iHero
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...