diff options
author | Strangerke | 2014-06-12 01:18:10 +0200 |
---|---|---|
committer | Strangerke | 2014-06-12 01:18:10 +0200 |
commit | 45f8bd755cd6d741f6c342272e01ce1af6464ea7 (patch) | |
tree | eab0d5f3c7b417da3d2ad63881fe18ce2cbb2269 /engines | |
parent | 5a5fe344a0f26f164b4908109bbf7cfa39e6c47f (diff) | |
download | scummvm-rg350-45f8bd755cd6d741f6c342272e01ce1af6464ea7.tar.gz scummvm-rg350-45f8bd755cd6d741f6c342272e01ce1af6464ea7.tar.bz2 scummvm-rg350-45f8bd755cd6d741f6c342272e01ce1af6464ea7.zip |
CGE2: Fix code computing distance
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/hero.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 5efb24e88d..d6dab6d3f0 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -245,7 +245,7 @@ int Hero::distance(V3D pos) { V3D di = _pos3D - pos; long x = V2D::round(di._x); long z = V2D::round(di._z); - return ((x * x + z * z) * (x * x + z * z)); + return (int)sqrt((long double)(x * x + z * z)); } int Hero::distance(Sprite *spr) { |