mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 20:07:11 +00:00
CGE2: Add a big hack to work around the coordinates issue
This commit is contained in:
parent
0eece817eb
commit
840eef8eb1
@ -1010,7 +1010,8 @@ void Sprite::touch(uint16 mask, V2D pos, Common::KeyCode keyCode) {
|
||||
} else { // sprite NOT in pocket
|
||||
Hero *h = _vm->_heroTab[_vm->_sex]->_ptr;
|
||||
if (!_vm->_talk) {
|
||||
if ((_ref & 0xFF) < 200 && h->distance(this) > (h->_maxDist << 1))
|
||||
// HACK: the "+3" is a ugly hack used to compensate a pathfinding issue. To be fixed!!
|
||||
if ((_ref & 0xFF) < 200 && h->distance(this) > (h->_maxDist << 1) + 3)
|
||||
h->walkTo(this);
|
||||
else if (_vm->_sys->_blinkSprite) {
|
||||
if (works(_vm->_sys->_blinkSprite)) {
|
||||
|
@ -314,7 +314,8 @@ int Hero::distance(V3D pos) {
|
||||
V3D di = _pos3D - pos;
|
||||
int x = di._x.round();
|
||||
int z = di._z.round();
|
||||
return ((int)sqrt((long double)x * x + z * z));
|
||||
int retval = (int)sqrt((long double)x * x + z * z);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int Hero::distance(Sprite *spr) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user