Skip to content

Commit 97ed751

Browse files
committed
RELEASE v1.0
---------------------- Potions are now consumed from the inventory
1 parent a94880c commit 97ed751

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ZORK/Player.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,10 @@ void Player::Drink(const vector<string>& tokens)
511511
if (HP > GetMaxHP()) {
512512
HP = GetMaxHP();
513513
}
514-
515514
cout << "You drink " << potion->name << " and recover " << potion->combatVal << " HP." << endl;
515+
cout << "(The potion was consumed)" << endl;
516+
container.remove(potion);
517+
delete potion;
516518
}
517519
else
518520
cout << "You cannot drink this!" << endl;

0 commit comments

Comments
 (0)