Added a method for changing a client's controlled character. Clients now get back control if their character is revived via the debug console.

+ It's possible to give clients control of monsters, which should add some new gameplay possibilitie. ;)
This commit is contained in:
Joonas Rikkonen
2017-06-10 15:07:10 +03:00
parent 8886409d56
commit 9b0d7c1020
6 changed files with 151 additions and 46 deletions
+4 -4
View File
@@ -64,7 +64,7 @@ namespace Barotrauma
public Hull PreviousHull = null;
public Hull CurrentHull = null;
public readonly bool IsRemotePlayer;
public bool IsRemotePlayer;
private CharacterInventory inventory;
@@ -810,7 +810,7 @@ namespace Barotrauma
ViewTarget = null;
if (!AllowInput) return;
if (!(this is AICharacter) || controlled == this)
if (!(this is AICharacter) || controlled == this || IsRemotePlayer)
{
Vector2 targetMovement = GetTargetMovement();
@@ -1289,7 +1289,7 @@ namespace Barotrauma
{
foreach (Character c in CharacterList)
{
if (!(c is AICharacter)) continue;
if (!(c is AICharacter) && !c.IsRemotePlayer) continue;
if (GameMain.Server != null)
{
@@ -1432,7 +1432,7 @@ namespace Barotrauma
selectedConstruction = null;
}
if (controlled != this && !(this is AICharacter))
if (controlled != this && (!(this is AICharacter) || IsRemotePlayer))
{
if (!LockHands)
{