Skip to content

Commit

Permalink
Move check to better place
Browse files Browse the repository at this point in the history
  • Loading branch information
igorko committed Jul 7, 2012
1 parent 0bac0e9 commit 56fe7ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/GameStatePlay.cpp
Expand Up @@ -337,8 +337,6 @@ void GameStatePlay::checkLootDrop() {
void GameStatePlay::checkConsumable() {
if (powers->used_item != -1) {
if (menu->items->items[powers->used_item].type == ITEM_TYPE_CONSUMABLE) {
//don't use untransform item if hero is not transformed
if (powers->powers[menu->items->items[powers->used_item].power].spawn_type == "untransform" && !pc->stats.transformed) return;
menu->inv->remove(powers->used_item);
powers->used_item = -1;
}
Expand Down
3 changes: 3 additions & 0 deletions src/StatBlock.cpp
Expand Up @@ -508,6 +508,9 @@ StatBlock::~StatBlock() {
bool StatBlock::canUsePower(const Power &power, unsigned powerid) const {
// needed to unlock shapeshifter powers
if (transformed) return mp >= power.requires_mp;

//don't use untransform power if hero is not transformed
else if (power.spawn_type == "untransform" && !transformed) return false;
else
return (!power.requires_mental_weapon || wielding_mental)
&& (!power.requires_offense_weapon || wielding_offense)
Expand Down

0 comments on commit 56fe7ef

Please sign in to comment.