TODO: OPT: do this a lot smarter!
| 383 | |
| 384 | // TODO: OPT: do this a lot smarter! |
| 385 | int *CClient::GetInput(int Tick, int IsDummy) const |
| 386 | { |
| 387 | int Best = -1; |
| 388 | const int d = IsDummy ^ g_Config.m_ClDummy; |
| 389 | for(int i = 0; i < 200; i++) |
| 390 | { |
| 391 | if(m_aInputs[d][i].m_Tick != -1 && m_aInputs[d][i].m_Tick <= Tick && (Best == -1 || m_aInputs[d][Best].m_Tick < m_aInputs[d][i].m_Tick)) |
| 392 | Best = i; |
| 393 | } |
| 394 | |
| 395 | if(Best != -1) |
| 396 | return (int *)m_aInputs[d][Best].m_aData; |
| 397 | return nullptr; |
| 398 | } |
| 399 | |
| 400 | // ------ state handling ----- |
| 401 | void CClient::SetState(EClientState State) |
no outgoing calls
no test coverage detected