fixed items display bug
This commit is contained in:
@@ -2,7 +2,7 @@ Room name: Circle Room
|
|||||||
Room Description: You are in a circular room. The windows to the east are covered with boards that<br>let in just enough light to see. You spot a man in a tailored suit moving some crates around.
|
Room Description: You are in a circular room. The windows to the east are covered with boards that<br>let in just enough light to see. You spot a man in a tailored suit moving some crates around.
|
||||||
Locked: false
|
Locked: false
|
||||||
Boarded: false
|
Boarded: false
|
||||||
Items: Shavingcream
|
Items: Lightbulb, Candlestick
|
||||||
Riddler: "Hello there. My name is Kevin and I am Sir Pellatt's butler. I understand that my master<comma><br>Sir Pellatt has wrongfully imprisoned you. If you answer my riddle<comma> I can give you something to<br>help you with your escape - nothing comes for free you know!", "What goes moo?", "Cows", Lockpick
|
Riddler: "Hello there. My name is Kevin and I am Sir Pellatt's butler. I understand that my master<comma><br>Sir Pellatt has wrongfully imprisoned you. If you answer my riddle<comma> I can give you something to<br>help you with your escape - nothing comes for free you know!", "What goes moo?", "Cows", Lockpick
|
||||||
Exit Rooms: W-Apple Hallway
|
Exit Rooms: W-Apple Hallway
|
||||||
|
|
||||||
|
|||||||
@@ -197,12 +197,15 @@ class Room {
|
|||||||
boolean hasItems = false;
|
boolean hasItems = false;
|
||||||
String items = "";
|
String items = "";
|
||||||
String itemString = "Items in room: ";
|
String itemString = "Items in room: ";
|
||||||
for(int i = 0; i < this.getItems().size() - 1; i++) {
|
if(this.getItems().size() > 0) {
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
items += this.getItems().get(i).getName() + ", ";
|
for(int i = 0; i < this.getItems().size() - 1; i++) {
|
||||||
|
hasItems = true;
|
||||||
|
items += this.getItems().get(i).getName() + ", ";
|
||||||
|
}
|
||||||
|
items += this.getItems().get(this.getItems().size() - 1).getName();
|
||||||
}
|
}
|
||||||
if(hasItems) {
|
if(hasItems) {
|
||||||
items += this.getItems().get(this.getItems().size() - 1).getName();
|
|
||||||
return itemString + items;
|
return itemString + items;
|
||||||
}else {
|
}else {
|
||||||
return itemString + "none";
|
return itemString + "none";
|
||||||
|
|||||||
Reference in New Issue
Block a user