Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npc: fix NPC followers not closing doors #27932

Merged
merged 1 commit into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/json/npcs/TALK_COMMON_ALLY.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
{
"truefalsetext": { "condition": { "npc_rule": "close_doors" }, "true": "Leave doors open.", "false": "Close the doors." },
"topic": "TALK_MISC_RULES",
"effect": { "toggle_npc_rule": "close_door" }
"effect": { "toggle_npc_rule": "close_doors" }
},
{ "text": "Set up pickup rules.", "topic": "TALK_MISC_RULES", "effect": "set_npc_pickup" },
{ "text": "Never mind.", "topic": "TALK_NONE" }
Expand Down
2 changes: 0 additions & 2 deletions src/npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ struct npc_follower_rules {
aim_rule aim = AIM_WHEN_CONVENIENT;
ally_rule flags;

bool close_doors;

pimpl<auto_pickup> pickup_whitelist;

npc_follower_rules();
Expand Down
2 changes: 1 addition & 1 deletion src/npcmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ void npc::move_to( const tripoint &pt, bool no_bashing, std::set<tripoint> *nomo
}

// Close doors behind self (if you can)
if( is_friend() && rules.close_doors ) {
if( is_friend() && rules.has_flag( ally_rule::close_doors ) ) {
doors::close_door( g->m, *this, old_pos );
}

Expand Down