Commit c36ab53b35e336e21fce5943d7d609ea02f8cea9
- Diff rendering mode:
- inline
- side by side
src/being.cpp
(7 / 1)
|   | |||
| 192 | 192 | it++; | |
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | // Remove the last path node, as it's more clever to go to mDest instead. | ||
| 196 | // It also permit to avoid zigzag at the end of the path, | ||
| 197 | // especially with mouse. | ||
| 198 | thisPath.pop_back(); | ||
| 199 | thisPath.push_back(Position(mDest.x, mDest.y)); | ||
| 200 | |||
| 195 | 201 | setPath(thisPath); | |
| 196 | 202 | } | |
| 197 | 203 | #endif // TMWSERV_SUPPORT | |
| … | … | ||
| 540 | 540 | const float nominalLength = dir.length(); | |
| 541 | 541 | ||
| 542 | 542 | // When we've not reached our destination, move to it. | |
| 543 | if (nominalLength > 0.0f && mWalkSpeed > 0.0f) | ||
| 543 | if (nominalLength > 1.0f && mWalkSpeed > 0.0f) | ||
| 544 | 544 | { | |
| 545 | 545 | ||
| 546 | 546 | // The private mWalkSpeed member is the speed in tiles per second. |
|   | |||
| 381 | 381 | ||
| 382 | 382 | void PlayerHandler::changeAction(Being::Action action) | |
| 383 | 383 | { | |
| 384 | if (action == Being::SIT) | ||
| 385 | player_node->setAction(action); | ||
| 384 | player_node->setAction(action); | ||
| 386 | 385 | ||
| 387 | 386 | MessageOut msg(PGMSG_ACTION_CHANGE); | |
| 388 | 387 | msg.writeInt8(action); |

