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

Engine crashes on warp(Occasionally)


purplystuff
 Share

Recommended Posts

Sometimes when I warp in game the engine crashes.. source says a direction block error… Anybody know why or how to fix...

```

' check directional blocking

If isDirBlocked(Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex)).DirBlock, Direction + 1) Then

CheckDirection = True

Exit Function

End If

```
Link to comment
Share on other sites

"Do not blame the coding, blame the coder."

^ Some quote that may or may not have been created but I'll take credit for posting it ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png)
Link to comment
Share on other sites

> "Do not blame the coding, blame the coder."
>
> ^ Some quote that may or may not have been created but I'll take credit for posting it ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png)

This is nothing helpful.

Purply, tell me as much as you can about the tile you're warping to. Does it matter which tile you're warping to, or is it any tile? What edits were made to the engine, or is it vanilla?
Link to comment
Share on other sites

> This is nothing helpful.
>
> Purply, tell me as much as you can about the tile you're warping to. Does it matter which tile you're warping to, or is it any tile? What edits were made to the engine, or is it vanilla?

It can be helpful ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)
Link to comment
Share on other sites

I know what issue you're having. I fixed it in TFF. I usually don't do this but I'll give you all my code.

```

Dim blockVar As Byte

On Error Resume Next

blockVar = Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex)).DirBlock

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo ErrorHandler

CheckDirection = False

' check directional blocking

If isDirBlocked(blockVar, direction + 1) And Player(MyIndex).Walkthrough = False Then

CheckDirection = True

Exit Function

End If

```

Just a quick way to clear it up. I'm sure there's a better way, but this works effectively.
Link to comment
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
 Share

×
×
  • Create New...