MCPcopy Create free account
hub / github.com/crawl/crawl / update

Method update

crawl-ref/source/tilereg-abl.cc:201–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void AbilityRegion::update()
202{
203 m_items.clear();
204 m_dirty = true;
205
206 if (mx * my == 0)
207 return;
208
209 const unsigned int max_abilities = min(get_max_slots(), mx*my);
210
211 vector<talent> talents = your_talents(true);
212 if (talents.empty())
213 return;
214
215 vector<InventoryTile> m_invoc;
216
217 for (const auto &talent : talents)
218 {
219 if (talent.is_invocation)
220 m_invoc.push_back(_tile_for_ability(talent.which));
221 else
222 m_items.push_back(_tile_for_ability(talent.which));
223
224 if (m_items.size() >= max_abilities)
225 return;
226 }
227
228 for (const auto &tile : m_invoc)
229 {
230 m_items.push_back(tile);
231 if (m_items.size() >= max_abilities)
232 return;
233 }
234}
235
236#endif

Callers

nothing calls this directly

Calls 6

your_talentsFunction · 0.85
_tile_for_abilityFunction · 0.85
clearMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected