mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
WAGE: Implement getValidMoveDirections()
This commit is contained in:
parent
9713e260a2
commit
851c2d6f70
@ -285,10 +285,26 @@ void WageEngine::performTake(Chr *npc, Obj *obj) {
|
||||
_world->move(obj, npc);
|
||||
}
|
||||
|
||||
int WageEngine::getValidMoveDirections(Chr *npc) {
|
||||
warning("STUB: getValidMoveDirections()");
|
||||
static const int directionsX[] = { 0, 0, 1, -1 };
|
||||
static const int directionsY[] = { -1, 1, 0, 0 };
|
||||
|
||||
return 0;
|
||||
int WageEngine::getValidMoveDirections(Chr *npc) {
|
||||
int directions = 0;
|
||||
Scene *currentScene = npc->_currentScene;
|
||||
for (int dir = 0; dir < 4; dir++) {
|
||||
if (!currentScene->_blocked[dir]) {
|
||||
int destX = currentScene->_worldX + directionsX[dir];
|
||||
int destY = currentScene->_worldY + directionsY[dir];
|
||||
|
||||
Scene *scene = _world->getSceneAt(destX, destY);
|
||||
|
||||
if (scene != NULL && scene->_chrs.size() == 0) {
|
||||
directions |= (1 << dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return directions;
|
||||
}
|
||||
|
||||
void WageEngine::regen() {
|
||||
@ -331,9 +347,6 @@ void WageEngine::takeObj(Obj *obj) {
|
||||
}
|
||||
}
|
||||
|
||||
static const int directionsX[] = { 0, 0, 1, -1 };
|
||||
static const int directionsY[] = { -1, 1, 0, 0 };
|
||||
|
||||
bool WageEngine::handleMoveCommand(Directions dir, const char *dirName) {
|
||||
Scene *playerScene = _world->_player->_currentScene;
|
||||
const char *msg = playerScene->_messages[dir].c_str();
|
||||
|
Loading…
x
Reference in New Issue
Block a user