Skip to content

Commit

Permalink
Don't crash on loss of target for ACT_READ
Browse files Browse the repository at this point in the history
This can occur if the book an NPC is reading is removed from their
inventory.
  • Loading branch information
ifreund committed Feb 25, 2020
1 parent 5231875 commit abdce8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,7 @@ void activity_handlers::read_finish( player_activity *act, player *p )
{
if( !act->targets.front() ) {
debugmsg( "Lost target of ACT_READ" );
return;
}
if( p->is_npc() ) {
npc *guy = dynamic_cast<npc *>( p );
Expand Down

0 comments on commit abdce8d

Please sign in to comment.