Commit ae8c3e89728ddc1f8e91e6e54ded039fd1fa600f

  • avatar
  • Bertram <bertram @ceg…el.net>
  • Fri Oct 16 01:12:09 CEST 2009
Made the keyboard walking pixel exact again.

What's left is working on player corner handling and directions while walking.
  
378378 mLocalWalkTime = tick_time;
379379 player_node->setDestination(event.getX() + (int) mPixelViewX,
380380 event.getY() + (int) mPixelViewY);
381 player_node->pathSetByMouse();
381382 }
382383#else
383384 player_node->setDestination(tilex, tiley);
  
103103 mTrading(false), mGoingToTarget(false), mKeepAttacking(false),
104104 mLastAction(-1),
105105 mWalkingDir(0),
106 mPathSetByMouse(false),
106107 mDestX(0), mDestY(0),
107108 mInventory(new Inventory(INVENTORY_SIZE)),
108109#ifdef TMWSERV_SUPPORT
539539 player_node->stopWalking(false);
540540
541541 // Else, he is not pressing a key,
542 // And the current path is over. Then, stop (sending to server).
543 else if (!dir && mPath.empty())
542 // and the current path hasn't been sent by mouse,
543 // then, stop (sending to server).
544 else if (!dir)
544545 {
545 player_node->stopWalking(true);
546 if (!mPathSetByMouse)
547 player_node->stopWalking(true);
546548 return;
547549 }
548550
643643 getPosition().y);
644644 setAction(STAND);
645645 }
646
647 // No path set anymore, so we reset the path by mouse flag
648 mPathSetByMouse = false;
646649
647650 clearPath();
648651}
  
367367
368368 std::pair<int, int> getExperience(int skill);
369369
370 /** Tells the path has been set by mouse */
371 void pathSetByMouse()
372 { mPathSetByMouse = true; }
373
370374 bool mUpdateName; /** Whether or not the name settings have changed */
371375
372376 bool mMapInitialized; /** Whether or not the map is available yet */
428428 bool mKeepAttacking; /** Whether or not to continue to attack */
429429 int mLastAction; /**< Time stamp of the last action, -1 if none. */
430430 int mWalkingDir; /**< The direction the player is walking in. */
431 bool mPathSetByMouse; /**< Tells if the path was set using mouse */
431432 int mDestX; /**< X coordinate of destination. */
432433 int mDestY; /**< Y coordinate of destination. */
433434