MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / SaveHotkeys

Function SaveHotkeys

Source/loadsave.cpp:2228–2246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2226}
2227
2228void SaveHotkeys(SaveWriter &saveWriter, const Player &player)
2229{
2230 SaveHelper file(saveWriter, "hotkeys", HotkeysSize());
2231
2232 // Write the number of spell hotkeys
2233 file.WriteLE<uint8_t>(static_cast<uint8_t>(NumHotkeys));
2234
2235 // Write the spell hotkeys
2236 for (auto &spellId : player._pSplHotKey) {
2237 file.WriteLE<int32_t>(static_cast<int8_t>(spellId));
2238 }
2239 for (auto &spellType : player._pSplTHotKey) {
2240 file.WriteLE<uint8_t>(static_cast<uint8_t>(spellType));
2241 }
2242
2243 // Write the selected spell last
2244 file.WriteLE<int32_t>(static_cast<int8_t>(player._pRSpell));
2245 file.WriteLE<uint8_t>(static_cast<uint8_t>(player._pRSplType));
2246}
2247
2248void LoadHeroItems(Player &player)
2249{

Callers 2

pfile_write_heroFunction · 0.85
pfile_ui_save_createFunction · 0.85

Calls 1

HotkeysSizeFunction · 0.85

Tested by

no test coverage detected