MCPcopy Create free account
hub / github.com/EasyRPG/Player / CheckEnable

Method CheckEnable

src/window_shopbuy.cpp:97–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97bool Window_ShopBuy::CheckEnable(int item_id) {
98 const lcf::rpg::Item* item = lcf::ReaderUtil::GetElement(lcf::Data::items, item_id);
99 if (!item) {
100 return false;
101 }
102
103 return (item->price <= Main_Data::game_party->GetGold() &&
104 Main_Data::game_party->GetItemCount(item_id) < Main_Data::game_party->GetMaxItemCount(item_id));
105}

Callers

nothing calls this directly

Calls 3

GetGoldMethod · 0.80
GetMaxItemCountMethod · 0.80
GetItemCountMethod · 0.45

Tested by

no test coverage detected