Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void OnCharacterAppearanceChanged(int oldValue, int newValue)
SetAppearanceSwap();
}

private void OnStealthyChanged(byte oldValue, byte newValue)
private void OnStealthyChanged(bool oldValue, bool newValue)
{
SetAppearanceSwap();
}
Expand All @@ -261,7 +261,7 @@ private void SetAppearanceSwap()
{
if (m_CharacterSwapper)
{
if (m_NetState.IsStealthy.Value != 0 && !m_NetState.IsOwner)
if (m_NetState.IsStealthy.Value && !m_NetState.IsOwner)
{
// this character is in "stealth mode", so other players can't see them!
m_CharacterSwapper.SwapAllOff();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override bool Start()
if (!movement.IsPerformingForcedMovement())
{
movement.CancelMove();
}
}
return true;
}

Expand All @@ -40,7 +40,7 @@ public override bool Update()
{
// start actual stealth-mode... NOW!
m_IsStealthStarted = true;
m_Parent.NetState.IsStealthy.Value = 1;
m_Parent.NetState.IsStealthy.Value = true;
}
return !m_IsStealthEnded;
}
Expand All @@ -66,7 +66,7 @@ private void EndStealth()
m_IsStealthEnded = true;
if (m_IsStealthStarted)
{
m_Parent.NetState.IsStealthy.Value = 0;
m_Parent.NetState.IsStealthy.Value = false;
}

// note that we cancel the ActionFX here, and NOT in Cancel(). That's to handle the case where someone
Expand Down
2 changes: 1 addition & 1 deletion Assets/BossRoom/Scripts/Server/Game/Character/AIBrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public bool IsAppropriateFoe(ServerCharacter potentialFoe)
if (potentialFoe == null ||
potentialFoe.IsNpc ||
potentialFoe.NetState.NetworkLifeState.Value != LifeState.Alive ||
potentialFoe.NetState.IsStealthy.Value != 0)
potentialFoe.NetState.IsStealthy.Value)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ public void InitNetworkPositionAndRotationY(Vector3 initPosition, float initRota
/// <summary>
/// Indicates whether this character is in "stealth mode" (invisible to monsters and other players).
/// </summary>
/// <remarks>
/// FIXME: this should be a bool, but NetworkedVarBool doesn't work at the moment! It's serialized
/// as a bit, but deserialized as a byte, which corrupts the whole network-var stream.
/// </remarks>
public NetworkVariableByte IsStealthy { get; } = new NetworkVariableByte(0);
public NetworkVariableBool IsStealthy { get; } = new NetworkVariableBool();

[SerializeField]
NetworkHealthState m_NetworkHealthState;
Expand Down