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: only report attitude changes that the avatar can see #37896

Merged

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Feb 10, 2020

Summary

SUMMARY: Bugfixes "npc: only report attitude changes that the avatar can see"

Purpose of change

Fixes #37415

NPCs that spawn near to the avatar but out of sight and are scared of the avatar will cause a message to appear in the message log, "$NPCname gets scared!" The player shouldn't get this information unless the avatar can see the NPC in question. Add a condition to the if test that
reports the change to make sure the avatar can see the NPC.

Describe the solution

It's just && g->u.sees( *this ) ; this is not super complicated.

Simple fix to stop the player from seeing attitude changes for
NPCs that the avatar cannot see.
@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Feb 10, 2020
@ZhilkinSerg
Copy link
Contributor

Fixes #37415?

@mlangsdorf
Copy link
Contributor Author

Sure, let's go with that.

@ZhilkinSerg ZhilkinSerg merged commit f7a5213 into CleverRaven:master Feb 11, 2020
@mlangsdorf mlangsdorf deleted the visible_npc_attitude_change branch February 12, 2020 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random NPC scared messages appear at any distance
2 participants