From 2da410118e26affb6a17824c5712f07a307b864b Mon Sep 17 00:00:00 2001 From: Oskar Wiksten Date: Fri, 22 Feb 2013 12:14:59 +0100 Subject: [PATCH] Only notify rewards in conversation if there actually are any. --- .../controller/ConversationController.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java index 608074d0a..7c666c6fc 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java @@ -40,7 +40,15 @@ public final class ConversationController { public final ArrayList actorConditions = new ArrayList(); public final ArrayList skillIncrease = new ArrayList(); public final ArrayList questProgress = new ArrayList(); - } + + public boolean isEmpty() { + if (loot.hasItemsOrExp()) return false; + if (!actorConditions.isEmpty()) return false; + if (!skillIncrease.isEmpty()) return false; + if (!questProgress.isEmpty()) return false; + return true; + } + } private PhraseRewards applyPhraseRewards(final Player player, final Phrase phrase) { if (phrase.rewards == null || phrase.rewards.length == 0) return null; @@ -65,9 +73,12 @@ public final class ConversationController { break; } } - + + if (result.isEmpty()) return null; + player.inventory.add(result.loot); controllers.actorStatsController.addExperience(result.loot.exp); + return result; }