Skip to content

Commit

Permalink
Work around NPC aborting activity due to unbuilt light map
Browse files Browse the repository at this point in the history
Light map is only built on the player character's z level even with 3D FOV on, and building the light map on all NPCs' levels might be too expensive, so simply let NPCs finish their business when not on the player character's z-level for now, like what was done for non-3D-FOV mode.
  • Loading branch information
Qrox committed Jan 28, 2024
1 parent 60214fe commit 65bbb37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2830,8 +2830,7 @@ float Character::fine_detail_vision_mod( const tripoint &p ) const
tripoint const check_p = p == tripoint_min ? pos() : p;
tripoint const avatar_p = get_avatar().pos();
// Light might not have been calculated on the NPC's z-level
if( is_avatar() || check_p.z == avatar_p.z ||
std::abs( avatar_p.z - check_p.z ) <= fov_3d_z_range ) {
if( is_avatar() || check_p.z == avatar_p.z ) {
ambient_light = std::max( 1.0f,
LIGHT_AMBIENT_LIT - get_map().ambient_light_at( check_p ) + 1.0f );
} else {
Expand Down

0 comments on commit 65bbb37

Please sign in to comment.