Skip to content

Commit

Permalink
some improvements for roll state
Browse files Browse the repository at this point in the history
  • Loading branch information
in0finite committed May 31, 2020
1 parent 95120b4 commit 626567e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 8 additions & 6 deletions Assets/Scripts/Behaviours/Ped/States/RollState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ void OnDictChanged(Ped.SyncDictionaryStringUint.Operation op, string key, uint v
// break;
// }

Debug.LogFormat("OnDictChanged() - op: {0}, key: {1}, value: {2}", op, key, value);
//Debug.LogFormat("OnDictChanged() - op: {0}, key: {1}, value: {2}", op, key, value);

if (!this.IsActiveState)
return;

if (key != kRollDirSyncName)
return;
Expand All @@ -93,11 +96,10 @@ void OnDictChanged(Ped.SyncDictionaryStringUint.Operation op, string key, uint v
if (m_ped.syncDictionaryStringUint.ContainsKey(key))
{
// roll direction possibly changed
bool oldLeft = m_rollLeft;
m_rollLeft = m_ped.syncDictionaryStringUint[key] == 1;
Debug.LogFormat("roll dir changed - old left: {0}, new left: {1}", oldLeft, m_rollLeft);
if (oldLeft != m_rollLeft)
this.PlayAnim();
//Debug.LogFormat("roll dir changed - old left: {0}, new left: {1}", oldLeft, m_rollLeft);
this.PlayAnim();
m_animState.time = 0f;
}
});

Expand Down Expand Up @@ -150,7 +152,7 @@ void PlayAnim()
// clients have wrap mode set to 'Loop', because state can be switched very fast between roll and crouchaim, and
// server will not update current state syncvar, so client will not start the state again,
// and roll state will remain
m_animState.wrapMode = m_isServer ? WrapMode.Once : WrapMode.Loop;
m_animState.wrapMode = WrapMode.Once;
m_model.VelocityAxis = 0; // movement will be done along x axis

}
Expand Down
6 changes: 0 additions & 6 deletions Docs/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@

- Does 'O' button changes quality level ?

- Client can't enter vehicle state - print additional state data ;

- Ped runs through ground when playing run-aim anim with mp5, ak47, etc... when holding gun with 2 hands

- Rolling: when doing more rolls in a sequence, roll direction can change, and client only uses the original direction

- Play sounds: horn ; empty weapon slot ; ped damage ; footsteps in run and sprint states ;

- Script execution order: HUD before pause menu and windows ; fps counter after all ;
Expand Down

0 comments on commit 626567e

Please sign in to comment.