Skip to content

Commit

Permalink
Call learnWordsInCurrentConversation in overloaded SpeakerNPC.say...
Browse files Browse the repository at this point in the history
...method
  • Loading branch information
AntumDeluge committed Jun 13, 2024
1 parent 0c2ff23 commit 4e4fa1a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/games/stendhal/server/entity/npc/SpeakerNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,14 @@ public boolean isTalking() {
public void say(final String text) {
// turn towards player if necessary, then say it.
say(text, true);
}

protected void say(final String text, final boolean turnToPlayer) {
// be polite and face the player we are talking to
if (turnToPlayer && (attending != null)) {
faceToward(attending);
}
super.say(text);
learnWordsInCurrentConversation(text);
}

Expand Down Expand Up @@ -546,15 +554,6 @@ private void learnWordsInCurrentConversation(String text) {
}
}

protected void say(final String text, final boolean turnToPlayer) {
// be polite and face the player we are talking to
if (turnToPlayer && (attending != null)) {
faceToward(attending);
}

super.say(text);
}

/** Message when NPC is attending another player.
* @param text to say to bothering player
* @param action to perform
Expand Down

0 comments on commit 4e4fa1a

Please sign in to comment.