Compatibility fix to cv981 new speed law.
* Also a minor fix to setting client version.
This commit is contained in:
		
							parent
							
								
									44e428bccb
								
							
						
					
					
						commit
						034c768994
					
				| 
						 | 
					@ -672,9 +672,11 @@ Point Creature::getDrawOffset()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int Creature::getStepDuration()
 | 
					int Creature::getStepDuration()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int speed = m_speed * 2;
 | 
					    int speed = m_speed;
 | 
				
			||||||
    int groundSpeed = 0;
 | 
					    if(g_game.getFeature(Otc::GameNewSpeedLaw))
 | 
				
			||||||
 | 
					        speed *= 2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int groundSpeed = 0;
 | 
				
			||||||
    Position tilePos = m_lastStepToPosition;
 | 
					    Position tilePos = m_lastStepToPosition;
 | 
				
			||||||
    if(!tilePos.isValid())
 | 
					    if(!tilePos.isValid())
 | 
				
			||||||
        tilePos = m_position;
 | 
					        tilePos = m_position;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,6 +40,7 @@ Game::Game()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    resetGameStates();
 | 
					    resetGameStates();
 | 
				
			||||||
    m_protocolVersion = 0;
 | 
					    m_protocolVersion = 0;
 | 
				
			||||||
 | 
					    m_clientVersion = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Game::terminate()
 | 
					void Game::terminate()
 | 
				
			||||||
| 
						 | 
					@ -1265,7 +1266,7 @@ void Game::setClientVersion(int version)
 | 
				
			||||||
    if(isOnline())
 | 
					    if(isOnline())
 | 
				
			||||||
        stdext::throw_exception("Unable to change client version while online");
 | 
					        stdext::throw_exception("Unable to change client version while online");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(version != 0 && (version < 981 || version > 981))
 | 
					    if(version != 0 && (version < 810 || version > 981))
 | 
				
			||||||
        stdext::throw_exception(stdext::format("Client version %d not supported", version));
 | 
					        stdext::throw_exception(stdext::format("Client version %d not supported", version));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_clientVersion = version;
 | 
					    m_clientVersion = version;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue