Skip to content

Instantly share code, notes, and snippets.

@jeedee
Created May 17, 2010 15:30
Show Gist options
  • Save jeedee/403883 to your computer and use it in GitHub Desktop.
Save jeedee/403883 to your computer and use it in GitHub Desktop.
Public Sub Send_MapData(Index As Integer, MapID As String)
Dim Xoffset As Integer
Dim Yoffset As Integer
Dim X As Integer
Dim Y As Integer
Dim xx As Integer
Dim yy As Integer
Dim temp As String
Let Xoffset = Asc(Mid$(MapID, 5, 1))
Let Yoffset = Asc(Mid$(MapID, 6, 1))
Let xx = Asc(Mid$(MapID, 2, 1))
Let yy = Asc(Mid$(MapID, 4, 1))
Let temp = MapID
For Y = 1 To Yoffset
For X = 1 To Xoffset
If xx + X <= cMap(cChar(Index).Map).X And yy + Y <= cMap(cChar(Index).Map).Y Then
Let temp = temp & Chr$(Int(cMap(cChar(Index).Map).Tile(xx + X, yy + Y).Tile / 256)) _
& Chr$(Int(cMap(cChar(Index).Map).Tile(xx + X, yy + Y).Tile Mod 256)) _
& Chr$(0) & Chr$(0) & Chr$(Int(cMap(cChar(Index).Map).Tile(xx + X, yy + Y).Object / 256)) _
& Chr$(Int(cMap(cChar(Index).Map).Tile(xx + X, yy + Y).Object) Mod 256)
End If
Next X
Next Y
If Len(temp) > 6 Then
Let temp = cPacket.Create_Packet(6, temp, 3)
Call cGame.Send(Index, temp)
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment