Fixed index for steering events - physical replays now appear to be identical

to the original recording.
This commit is contained in:
hiker 2018-01-10 18:37:12 +11:00
parent f5af65f4ef
commit 4c6a226968

View File

@ -84,7 +84,9 @@ void History::allocateMemory(int number_of_frames)
void History::addEvent(int kart_id, PlayerAction pa, int value) void History::addEvent(int kart_id, PlayerAction pa, int value)
{ {
InputEvent ie; InputEvent ie;
ie.m_index = m_current; // The event is added before m_current is increased. So in order to
// save the right index for this event, we need to use m_current+1.
ie.m_index = m_current+1;
ie.m_action = pa; ie.m_action = pa;
ie.m_value = value; ie.m_value = value;
ie.m_kart_index = kart_id; ie.m_kart_index = kart_id;