4 truth OpenableItems
= Char
->GetStack()->SortedItems(Char
, &item::IsOpenable
);
7 Key
= game::AskForKeyPress(CONST_S("What do you wish to open? [press a direction key, space or i]"));
9 Key
= game::AskForKeyPress(CONST_S("What do you wish to open? [press a direction key or space]"));
12 if (OpenableItems
&& (Key
== 'i' || Key
== 'I')) {
13 item
*Item
= Char
->GetStack()->DrawContents(Char
, CONST_S("What do you want to open?"), 0, &item::IsOpenable
);
14 return Item
&& Item
->Open(Char
);
16 v2 DirVect
= game::GetDirectionVectorForKey(Key
);
17 if (DirVect
!= ERROR_V2
&& Char
->GetArea()->IsValidPos(Char
->GetPos()+DirVect
)) return Char
->GetNearLSquare(Char
->GetPos()+DirVect
)->Open(Char
);
19 ADD_MESSAGE("This monster type cannot open anything.");