mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
Take CalculateDistance and CalculateHorizontalDistance out of header file as they can be static now.
Add documentation for said functions.
This commit is contained in:
parent
53cd3add4f
commit
3efa8f16b7
2 changed files with 2 additions and 6 deletions
|
@ -143,13 +143,13 @@ static void InventorySeparate(int slot)
|
|||
|
||||
}
|
||||
|
||||
int CalculateDistance(GameScriptPosition const & pos1, GameScriptPosition const & pos2)
|
||||
static int CalculateDistance(GameScriptPosition const & pos1, GameScriptPosition const & pos2)
|
||||
{
|
||||
auto result = sqrt(SQUARE(pos1.x - pos2.x) + SQUARE(pos1.y - pos2.y) + SQUARE(pos1.z - pos2.z));
|
||||
return static_cast<int>(round(result));
|
||||
}
|
||||
|
||||
int CalculateHorizontalDistance(GameScriptPosition const & pos1, GameScriptPosition const & pos2)
|
||||
static int CalculateHorizontalDistance(GameScriptPosition const & pos1, GameScriptPosition const & pos2)
|
||||
{
|
||||
auto result = sqrt(SQUARE(pos1.x - pos2.x) + SQUARE(pos1.z - pos2.z));
|
||||
return static_cast<int>(round(result));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue