Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Don't load the map twice
#9
Ok I hate to bring this up again(cause of old date), but I noticed that I of course still had the bug where it ALWAYS requested a new map.

Well I made these changes and it seems to work perfectly fine now.

I Changed:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, True) Then
To:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, False) = True Then


Code:
If FileExist(MAP_PATH & "map" & x & MAP_EXT, False) = True Then
            ' Check to see if the revisions match
            If GetMapRevision(x) = y Then

                Call LoadMap(x)
                Call SendData("needmap" & SEP_CHAR & "no" & SEP_CHAR & END_CHAR)
                Exit Sub
            End If
        End If
        
        ' Either the revisions didn't match or we dont have the map, so we need it
        Call SendData("needmap" & SEP_CHAR & "yes" & SEP_CHAR & END_CHAR)
        Exit Sub
    End If

I tested it and had it display every time I was on a new map or an old map; had my girlfriend make a simple change and it showed I was on a new map. While walking around on the old maps it displayed I was on an old map.

I noticed their was an optimizing tutorial and some other stuff. Do they make this any better? Cause the fix I made actually seemed to work perfectly fine all the time and I noticed that the maps were loading quicker.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)