summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/actor-los.cc
Commit message (Collapse)AuthorAgeFilesLines
* More formatting fixes for return (...);Neil Moore2013-11-151-4/+4
|
* Remove get_los().Adam Borowski2013-11-051-31/+0
|
* Drop an always true check.Adam Borowski2013-11-051-1/+1
| | | | In a virtual method, you can be quite certain we're of the correct type.
* Make actor->get_los() const.Adam Borowski2013-10-311-3/+3
| | | | Really, I'd like to make it nonexistant instead...
* Don't crash when returning to an level with scrying active (#7387)Neil Moore2013-07-281-1/+3
| | | | | | | | | | The player position is (0,0) in this case, while vlos still uses the location from the last level. This caused tile_draw_map_cell (called from level load) to refer to locations far outside the show area. Rather than forcing you.pos() and vlos to be in sync at this point during level load (which could e.g. reveal the upper left corner of the map), we take the easy way out and prevent a player at (0,0) from seeing anything (outside arena of course).
* Remove use of 'you' inside player member functionspubby2013-06-301-2/+2
| | | | | | 'you' seemed to be pointless in such context anyways, and lead to some const correctness bugs since '*this' could have a different const-ness from 'you'.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-3/+3
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Some more return deparenthesization.Adam Borowski2012-07-051-7/+7
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-3/+3
|
* Use actor->is_player() instead of (actor == &you) as well.Adam Borowski2012-03-221-4/+3
| | | | | | | Not so sure here as the latter is a bit faster (comparison with a constant vs a virtual method call), but consistency is good. Perhaps we should use the latter way after all? In any case, it should be the same everywhere -- if someone has some insight, say a word so we can sed it again.
* Ensure a space after "return".Adam Borowski2010-12-161-1/+1
| | | | It should never masquerade as a function call.
* Fix a crash in tiles with wizard x-ray / Ash scrying out of map bounds.Adam Borowski2010-11-011-1/+3
|
* Ashenzari's scrying.Adam Borowski2010-10-071-8/+2
| | | | | | | Smite-targetted spells shouldn't probably work through walls, they are not blocked yet, though. I dread the thousands places that assume vision to be reciprocal...
* Wizard mode xray vision (Ctrl-V).Robert Vollmert2010-07-201-1/+16
| | | | | It would be nice to expose the whole viewed area, but LOS code assumes circular bounds in a few places.
* Reorganize arena LOS overrides slightly.Robert Vollmert2010-07-201-9/+18
|
* Actors outside the map can't see anything.Robert Vollmert2010-06-051-1/+5
| | | | | This fixes crashes on player LOS checks while the player is off-level during level load.
* Fix arena with global LOS.Robert Vollmert2010-03-221-2/+9
| | | | | | | | For one, fix several crash bugs related to the player being outside LOS. These are prevented by checking against actor->alive() to check actor validity, and having you.alive() return false in the arena. Then, make sure LOS is actually invalidated for the arena, since that doesn't go through the usual level initialization path.
* Yet another version of arena LOS hacks.Robert Vollmert2010-03-221-8/+6
|
* Update actor::get_los to use global LOS.Robert Vollmert2010-03-221-36/+8
| | | | | | | | | | | | This is all not very nice. los_base is now an abstract base class for both los_def and los_glob (global LOS-backed los_def variant), and interators now take a *los_base. actor::update_los is gone. Arena LOS is quite probably broken again at the moment.
* Make actor::see_cell use global LOS.Robert Vollmert2010-03-221-2/+3
|
* Update monster's LOS if close enough to the player.Robert Vollmert2010-03-041-1/+8
| | | | | | | | Previously we skipped this if the monster couldn't be seen, but that may mean the monster thinks it can still see the player if say a door has been closed or the player has read ?fog. Fixes issue #1007.
* make 'game type' an enum rather than a bool, and serialize itJesse Luehrs2010-03-021-3/+3
|
* Hack monster LOS to reduce updates.Robert Vollmert2010-01-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | It's now only updated if the monster has moved or is in view of the player. That means it will not necessarily be accurate if terrain or clouds are LOS-affecting monsters change/move. I'm not sure that this is much better than just not updating LOS for sleeping monsters -- depends on to what extent monsters just stay in place. Previously, crawl spent a significant amount of time with the monster LOS updates. Other options: - Calculate monster LOS on-demand (unlikely to help much) - Reduce monster LOS range away from the player (this might require some changes to LOS code to actually save time) - Track LOS globally: for each cell, which other cells are visible? An estimated 200 kB of data. This would then only be updated if terrain/clouds/LOS-affecting monsters changed.
* Trim unnecessary #includes.Adam Borowski2010-01-131-1/+0
|
* Hack player::los for arena.Robert Vollmert2009-11-211-5/+2
| | | | | | This should fix recent arena display problems. Also fix los_def::in_bounds to translate coordinates.
* Fix player LOS when examining arena.Matthew Cline2009-11-151-2/+2
|
* Replace calc_show_los by you.update_los.Robert Vollmert2009-11-131-2/+5
|
* Move trans_wall_blocking into player.Robert Vollmert2009-11-131-0/+5
|
* Hack player LOS routines for arena.Robert Vollmert2009-11-131-1/+20
| | | | Player now sees everything in the arena.
* Add actor::get_los.Robert Vollmert2009-11-111-0/+5
|
* Move see_cell_no_trans into player.Robert Vollmert2009-11-081-0/+49
Also collect actor/player LOS code in actor-los.cc.