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

Function LoadQuest

Source/loadsave.cpp:868–898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866}
867
868void LoadQuest(LoadHelper *file, int i)
869{
870 auto &quest = Quests[i];
871
872 quest._qlevel = file->NextLE<uint8_t>();
873 file->Skip<uint8_t>(); // _qtype, identical to _qidx
874 quest._qactive = static_cast<quest_state>(file->NextLE<uint8_t>());
875 quest._qlvltype = static_cast<dungeon_type>(file->NextLE<uint8_t>());
876 quest.position.x = file->NextLE<int32_t>();
877 quest.position.y = file->NextLE<int32_t>();
878 quest._qslvl = static_cast<_setlevels>(file->NextLE<uint8_t>());
879 quest._qidx = static_cast<quest_id>(file->NextLE<uint8_t>());
880 if (gbIsHellfireSaveGame) {
881 file->Skip(2); // Alignment
882 quest._qmsg = static_cast<_speech_id>(file->NextLE<int32_t>());
883 } else {
884 quest._qmsg = static_cast<_speech_id>(file->NextLE<uint8_t>());
885 }
886 quest._qvar1 = file->NextLE<uint8_t>();
887 quest._qvar2 = file->NextLE<uint8_t>();
888 file->Skip(2); // Alignment
889 if (!gbIsHellfireSaveGame)
890 file->Skip(1); // Alignment
891 quest._qlog = file->NextBool32();
892
893 ReturnLvlPosition.x = file->NextBE<int32_t>();
894 ReturnLvlPosition.y = file->NextBE<int32_t>();
895 ReturnLevel = file->NextBE<int32_t>();
896 ReturnLevelType = static_cast<dungeon_type>(file->NextBE<int32_t>());
897 file->Skip(sizeof(int32_t)); // Skip DoomQuestState
898}
899
900void LoadLighting(LoadHelper *file, Light *pLight)
901{

Callers 1

LoadGameFunction · 0.85

Calls 2

NextBool32Method · 0.80
SkipMethod · 0.45

Tested by

no test coverage detected