cosmetix
[k8-i-v-a-n.git] / src / game / commands / Go.cpp
blobacbc95e7410fb0fcc7dde3b76a244918fe259601
1 COMMAND(Go) {
2 int Dir = game::DirectionQuestion(CONST_S("In what direction do you want to go? [press a direction key]"), false);
3 if (Dir == DIR_ERROR) return false;
4 go *Go = go::Spawn(Char);
5 Go->SetDirection(Dir);
6 Go->SetPrevWasTurn(false);
7 /*
8 int OKDirectionsCounter = 0;
9 for (int d = 0; d < Char->GetNeighbourSquares(); ++d) {
10 lsquare *Square = Char->GetNeighbourLSquare(d);
11 if (Square && Char->CanMoveOn(Square)) ++OKDirectionsCounter;
13 Go->SetIsWalkingInOpen(OKDirectionsCounter > 2);
15 Char->SetAction(Go);
16 Char->EditAP(Char->GetStateAPGain(100)); // gum solution
17 Char->GoOn(Go, true);
18 return truth(Char->GetAction());