SHARE
TWEET

CDDA trail line fix

a guest Oct 27th, 2013 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/animation_curses.cpp b/animation_curses.cpp
  2. index b727aa5..eabdcfa 100644
  3. --- a/animation_curses.cpp
  4. +++ b/animation_curses.cpp
  5. @@ -66,7 +66,6 @@ void game::draw_hit_player(player *p, bool dead)
  6.  
  7.  void game::draw_line(const int x, const int y, const point center_point, std::vector<point> ret)
  8.  {
  9. -    if (u_see( x, y))
  10.      {
  11.          for (int i = 0; i < ret.size(); i++)
  12.          {
  13. diff --git a/animation_tiles.cpp b/animation_tiles.cpp
  14. index c94beab..afa740c 100644
  15. --- a/animation_tiles.cpp
  16. +++ b/animation_tiles.cpp
  17. @@ -128,7 +128,6 @@ void game::draw_hit_player(player *p, bool dead)
  18.  
  19.  void game::draw_line(const int x, const int y, const point center_point, std::vector<point> ret)
  20.  {
  21. -    if (u_see( x, y))
  22.      {
  23.          for (int i = 0; i < ret.size(); i++)
  24.          {
  25. diff --git a/cata_tiles.cpp b/cata_tiles.cpp
  26. index c074345..bb6fd49 100644
  27. --- a/cata_tiles.cpp
  28. +++ b/cata_tiles.cpp
  29. @@ -1145,7 +1145,6 @@ void cata_tiles::draw_line(int destx, int desty, int centerx, int centery, int w
  30.  {
  31.      int mx = line_pos_x, my = line_pos_y;
  32.      std::string line_overlay = "animation_line";
  33. -    if (!is_target_line || g->u_see(mx,my))
  34.      {
  35.          for (int i = 0; i < line_trajectory.size()-1; i++)
  36.          {
  37. diff --git a/game.cpp b/game.cpp
  38. index f5546f8..a4038d5 100644
  39. --- a/game.cpp
  40. +++ b/game.cpp
  41. @@ -6967,10 +6967,7 @@ void game::draw_trail_to_square(int x, int y, bool bDrawX)
  42.      point center = point(u.posx + u.view_offset_x, u.posy + u.view_offset_y);
  43.      std::vector<point> vPoint = line_to(u.posx, u.posy, u.posx + x, u.posy + y, 0);
  44.  
  45. -    for (int i = 1; i < vPoint.size(); i++)
  46. -    {
  47. -        m.drawsq(w_terrain, u, vPoint[i-1].x, vPoint[i-1].y, true, true, center.x, center.y);
  48. -    }
  49. +    draw_line(x, y, center, vPoint);
  50.  
  51.      if (bDrawX) {
  52.          mvwputch(w_terrain, POSY + (vPoint[vPoint.size()-1].y - (u.posy + u.view_offset_y)),
  53. diff --git a/ranged.cpp b/ranged.cpp
  54. index e0ae2b8..7d699f1 100644
  55. --- a/ranged.cpp
  56. +++ b/ranged.cpp
  57. @@ -768,7 +768,8 @@ std::vector<point> game::target(int &x, int &y, int lowx, int lowy, int hix,
  58.  
  59.     // Only draw a highlighted trajectory if we can see the endpoint.
  60.     // Provides feedback to the player, and avoids leaking information about tiles they can't see.
  61. -   draw_line(x, y, center, ret);
  62. +   if (u_see(x, y))
  63. +    draw_line(x, y, center, ret);
  64.  /*
  65.     if (u_see( x, y)) {
  66.      for (int i = 0; i < ret.size(); i++) {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top