Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LeftGame Fix
#1
I'm not sure if this has been posted yet but it seems to be a small bug with the vanilla MSE1.

Basically what happens is when more than one person is online, on the same map, and someone logs off or gets booted, the map stops processing npc movement.

So, server side, find this:

Code:
Sub LeftGame(ByVal Index As Long)
Dim n As Long

    If Player(Index).InGame = True Then
        Player(Index).InGame = False
        
        ' Check if player was the only player on the map and stop npc processing if so
        If GetTotalMapPlayers(GetPlayerMap(Index)) = 1 Then
            PlayersOnMap(GetPlayerMap(Index)) = NO
        End If

and change it to this:

Code:
Sub LeftGame(ByVal Index As Long)
Dim n As Long

    If Player(Index).InGame = True Then
        Player(Index).InGame = False
        
        ' Check if player was the only player on the map and stop npc processing if so
        If GetTotalMapPlayers(GetPlayerMap(Index)) < 1 Then
            PlayersOnMap(GetPlayerMap(Index)) = NO
        End If

In the first block of code, the server stops processing npc movement if there is only 1 person on the map. Obviously, we want to keep processing them for that 1 person. All I've done here is changed the = to a < so that if there is less than one person on the map it stops processing movement. Some people may have noticed this, however I couldn't find anything on it and this stumped me for about 5 minutes.

More info here: viewtopic.php?f=7&t=1867
Reply
#2
From what I can see quickly it should be correct.
Reply
#3
This is an existing bugfix, and is probably in the old 'Temporary' archive.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#4
I never seen that bug fix before, so it was good you reposted it at least.
Reply
#5
It's in.. bugs and errors I think.

It's been posted a few times.
I actually meant to post it 2 days ago, but I forgot.

:oops:
Reply
#6
meh, I didn't look very hard, but then again I rarely do :roll: .

Anyways, I had never come across it before until now, for whatever reason, so I figured I'd post it anyway.

Edited post to have link from the other topic as well. verrigan had a different fix for it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)