Engine crashes on warp(Occasionally)

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

never had any problems with warping. Are you able to recreate this error?

Yea several times.

“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 ^_^

“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 ^_^

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?

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 ;)

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.

Log in to reply