Merge pull request #621 from eriktorbjorn/neverhood-car

NEVERHOOD: Possible fix for bad car behaviour
This commit is contained in:
Filippos Karapetis 2015-10-22 11:10:42 +03:00
commit 4a38e2618d
2 changed files with 8 additions and 8 deletions

View File

@ -761,7 +761,7 @@ void Scene2702::moveCarToPoint(NPoint pt) {
_tracks.findTrackPoint(pt, minMatchTrackIndex, minMatchDistance, _dataResource);
if (minMatchTrackIndex >= 0 && minMatchTrackIndex != _currTrackIndex) {
_newTrackIndex = minMatchTrackIndex;
_newTrackDestX = pt.x;
_newTrackDest = pt;
if (_isUpperTrack) {
if (_currTrackIndex == 0)
sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
@ -773,7 +773,7 @@ void Scene2702::moveCarToPoint(NPoint pt) {
sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
} else {
_newTrackIndex = -1;
sendMessage(_asCar, 0x2004, pt.x);
sendMessage(_asCar, 0x2004, pt);
}
}
@ -790,7 +790,7 @@ void Scene2702::changeTrack() {
sendMessage(_asCar, NM_POSITION_CHANGE, 0);
else
sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
sendMessage(_asCar, 0x2004, _newTrackDestX);
sendMessage(_asCar, 0x2004, _newTrackDest);
_newTrackIndex = -1;
}
@ -1092,14 +1092,14 @@ void Scene2706::moveCarToPoint(NPoint pt) {
_tracks.findTrackPoint(pt, minMatchTrackIndex, minMatchDistance, _dataResource);
if (minMatchTrackIndex >= 0 && minMatchTrackIndex != _currTrackIndex) {
_newTrackIndex = minMatchTrackIndex;
_newTrackDestX = pt.x;
_newTrackDest = pt;
if (_currTrackIndex == 0)
sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
else
sendMessage(_asCar, 0x2003, 0);
} else {
_newTrackIndex = -1;
sendMessage(_asCar, 0x2004, pt.x);
sendMessage(_asCar, 0x2004, pt);
}
}
@ -1111,7 +1111,7 @@ void Scene2706::changeTrack() {
sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
else
sendMessage(_asCar, NM_POSITION_CHANGE, 0);
sendMessage(_asCar, 0x2004, _newTrackDestX);
sendMessage(_asCar, 0x2004, _newTrackDest);
_newTrackIndex = -1;
}

View File

@ -76,7 +76,7 @@ protected:
Sprite *_asCarShadow;
Sprite *_asCarTrackShadow;
Sprite *_asCarConnectorShadow;
int16 _newTrackDestX;
NPoint _newTrackDest;
bool _isInLight;
int _currTrackIndex, _newTrackIndex;
bool _isUpperTrack;
@ -132,7 +132,7 @@ protected:
Sprite *_asCarConnector;
Sprite *_asCarTrackShadow;
Sprite *_asCarConnectorShadow;
int16 _newTrackDestX;
NPoint _newTrackDest;
int _currTrackIndex, _newTrackIndex;
Tracks _tracks;
NPointArray *_trackPoints;