Fix walk interval calculation
This commit is contained in:
		
							parent
							
								
									59b6abfa09
								
							
						
					
					
						commit
						8e437e27c7
					
				| 
						 | 
					@ -266,9 +266,9 @@ void Creature::walk(const Position& oldPos, const Position& newPos)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // calculates walk interval
 | 
					    // calculates walk interval
 | 
				
			||||||
    int groundSpeed = 0;
 | 
					    int groundSpeed = 0;
 | 
				
			||||||
    TilePtr oldTile = g_map.getTile(oldPos);
 | 
					    TilePtr tile = g_map.getTile(newPos);
 | 
				
			||||||
    if(oldTile)
 | 
					    if(tile)
 | 
				
			||||||
        groundSpeed = oldTile->getGroundSpeed();
 | 
					        groundSpeed = tile->getGroundSpeed();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    float interval = 1000;
 | 
					    float interval = 1000;
 | 
				
			||||||
    if(groundSpeed > 0 && m_speed > 0)
 | 
					    if(groundSpeed > 0 && m_speed > 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -526,7 +526,7 @@ void Game::autoWalk(const std::vector<Otc::Direction>& dirs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_protocolGame->sendAutoWalk(dirs);
 | 
					    m_protocolGame->sendAutoWalk(dirs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    g_lua.callGlobalField("g_game", "onAutoWalk", direction);
 | 
					    g_lua.callGlobalField("g_game", "onAutoWalk", dirs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Game::forceWalk(Otc::Direction direction)
 | 
					void Game::forceWalk(Otc::Direction direction)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue