Skip to content

Commit

Permalink
implement MultiPlayerSync
Browse files Browse the repository at this point in the history
This is mainly to fix cutscenes of the form:

LeaveAreaLUA(...)
MultiPlaySync()
MoveViewPoint(...)

Since the map hasn't changed yet when MoveViewPoint is reached,
the command fails (or gets overwritten later on when the map does
change). As a result the player is often left looking at the party
which isn't even supposed to be present in the scene while sounds
imply interesting things going on in other parts of the area.

Adding a wait in place of the MultiPlayerSync command makes sure
that the area changes before trying to set the new view point.
  • Loading branch information
fizzet committed Jun 15, 2013
1 parent b5bc53d commit 0d084a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gemrb/core/GameScript/Actions.cpp
Expand Up @@ -7145,4 +7145,9 @@ void GameScript::ChunkCreature(Scriptable *Sender, Action* parameters)
delete fx;
}

void GameScript::MultiPlayerSync(Scriptable* Sender, Action* /*parameters*/)
{
Sender->SetWait(1);
}

}
1 change: 1 addition & 0 deletions gemrb/core/GameScript/GameScript.cpp
Expand Up @@ -714,6 +714,7 @@ static const ActionLink actionnames[] = {
{"moveviewobject", GameScript::MoveViewObject, AF_BLOCKING},
{"moveviewpoint", GameScript::MoveViewPoint, AF_BLOCKING},
{"moveviewpointuntildone", GameScript::MoveViewPoint, 0},
{"multiplayersync", GameScript::MultiPlayerSync, 0},
{"nidspecial1", GameScript::NIDSpecial1,AF_BLOCKING|AF_DIRECT|AF_ALIVE},//we use this for dialogs, hack
{"nidspecial2", GameScript::NIDSpecial2,AF_BLOCKING},//we use this for worldmap, another hack
{"nidspecial3", GameScript::Attack,AF_BLOCKING|AF_DIRECT|AF_ALIVE},//this hack is for attacking preset target
Expand Down
1 change: 1 addition & 0 deletions gemrb/core/GameScript/GameScript.h
Expand Up @@ -1191,6 +1191,7 @@ class GEM_EXPORT GameScript {
static void MoveToSavedLocation(Scriptable* Sender, Action* parameters);
static void MoveViewPoint(Scriptable* Sender, Action* parameters);
static void MoveViewObject(Scriptable* Sender, Action* parameters);
static void MultiPlayerSync(Scriptable* Sender, Action* parameters);
static void NIDSpecial1(Scriptable* Sender, Action* parameters);
static void NIDSpecial2(Scriptable* Sender, Action* parameters);
static void NoAction(Scriptable* Sender, Action* parameters);
Expand Down

0 comments on commit 0d084a4

Please sign in to comment.