Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
8253 Bug Report minor N/A 2014-03-10 03:20 2014-03-10 04:02
floatingatoll Both  
gammafunk All  
normal Both  
resolved 0.14 ancient branch  
428849b03052c4253dbc0b0a2ced2c1b done  
none    
none 0.14 ancient branch  
0008253: while loop typo in 428849b0 "Make the monster throw ability use a ray path"
428849b03052c4253dbc0b0a2ced2c1bbc12745d (March 8, 2014) introduces the following compiler warning:

mon-abil.cc:5127:50: warning: while loop has empty body [-Wempty-body]
        while (ray.advance() && ray.pos() != *di);
                                                 ^
mon-abil.cc:5127:50: note: put the semicolon on a separate line to silence this warning


Which correctly identifies that there is something resembling a typo'd while loop in the code:

          while (ray.advance() && ray.pos() != *di);
          {
              if (!map_bounds(ray.pos()))
                  break;
          }


As written with the semicolon, it iterates over ray.advance() until exhausted, then does a single check of map_bounds(ray.pos) and breaks out of the distance_iterator for loop.

It seems likely that this was intended to break out of the while loop, implying that the semicolon should be removed.

Removing the semicolon clears the warnings. I'm not familiar with this code, so I don't know how to test the before/after behavior properly.
? file icon throw_raypath_while.patch [^] (487 bytes) 2014-03-10 03:20 [Show Content]
Issue History
2014-03-10 03:20 floatingatoll New Issue
2014-03-10 03:20 floatingatoll File Added: throw_raypath_while.patch
2014-03-10 04:02 gammafunk Note Added: 0025533
2014-03-10 04:02 gammafunk Status new => resolved
2014-03-10 04:02 gammafunk Fixed in Branch => 0.14 development branch
2014-03-10 04:02 gammafunk Resolution open => done
2014-03-10 04:02 gammafunk Assigned To => gammafunk

Notes
(0025533)
gammafunk   
2014-03-10 04:02   
Fixed in 0.14-a0-3168-gfdc5474, thanks!