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

Function LoadItemData

Source/loadsave.cpp:251–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249};
250
251void LoadItemData(LoadHelper &file, Item &item)
252{
253 item._iSeed = file.NextLE<uint32_t>();
254 item._iCreateInfo = file.NextLE<uint16_t>();
255 file.Skip(2); // Alignment
256 item._itype = static_cast<ItemType>(file.NextLE<uint32_t>());
257 item.position.x = file.NextLE<int32_t>();
258 item.position.y = file.NextLE<int32_t>();
259 item._iAnimFlag = file.NextBool32();
260 file.Skip(4); // Skip pointer _iAnimData
261 item.AnimInfo = {};
262 item.AnimInfo.numberOfFrames = file.NextLENarrow<int32_t, int8_t>();
263 item.AnimInfo.currentFrame = file.NextLENarrow<int32_t, int8_t>(-1);
264 file.Skip(8); // Skip _iAnimWidth and _iAnimWidth2
265 file.Skip(4); // Unused since 1.02
266 item._iSelFlag = file.NextLE<uint8_t>();
267 file.Skip(3); // Alignment
268 item._iPostDraw = file.NextBool32();
269 item._iIdentified = file.NextBool32();
270 item._iMagical = static_cast<item_quality>(file.NextLE<int8_t>());
271 file.NextBytes(item._iName, 64);
272 file.NextBytes(item._iIName, 64);
273 item._iLoc = static_cast<item_equip_type>(file.NextLE<int8_t>());
274 item._iClass = static_cast<item_class>(file.NextLE<uint8_t>());
275 file.Skip(1); // Alignment
276 item._iCurs = file.NextLE<int32_t>();
277 item._ivalue = file.NextLE<int32_t>();
278 item._iIvalue = file.NextLE<int32_t>();
279 item._iMinDam = file.NextLE<int32_t>();
280 item._iMaxDam = file.NextLE<int32_t>();
281 item._iAC = file.NextLE<int32_t>();
282 item._iFlags = static_cast<ItemSpecialEffect>(file.NextLE<uint32_t>());
283 item._iMiscId = static_cast<item_misc_id>(file.NextLE<int32_t>());
284 item._iSpell = static_cast<SpellID>(file.NextLE<int32_t>());
285 item._iCharges = file.NextLE<int32_t>();
286 item._iMaxCharges = file.NextLE<int32_t>();
287 item._iDurability = file.NextLE<int32_t>();
288 item._iMaxDur = file.NextLE<int32_t>();
289 item._iPLDam = file.NextLE<int32_t>();
290 item._iPLToHit = file.NextLE<int32_t>();
291 item._iPLAC = file.NextLE<int32_t>();
292 item._iPLStr = file.NextLE<int32_t>();
293 item._iPLMag = file.NextLE<int32_t>();
294 item._iPLDex = file.NextLE<int32_t>();
295 item._iPLVit = file.NextLE<int32_t>();
296 item._iPLFR = file.NextLE<int32_t>();
297 item._iPLLR = file.NextLE<int32_t>();
298 item._iPLMR = file.NextLE<int32_t>();
299 item._iPLMana = file.NextLE<int32_t>();
300 item._iPLHP = file.NextLE<int32_t>();
301 item._iPLDamMod = file.NextLE<int32_t>();
302 item._iPLGetHit = file.NextLE<int32_t>();
303 item._iPLLight = file.NextLE<int32_t>();
304 item._iSplLvlAdd = file.NextLE<int8_t>();
305 item._iRequest = file.NextBool8();
306 file.Skip(2); // Alignment
307 item._iUid = file.NextLE<int32_t>();
308 item._iFMinDam = file.NextLE<int32_t>();

Callers 2

LoadAndValidateItemDataFunction · 0.85
LoadMatchingItemsFunction · 0.85

Calls 7

RemapItemIdxFromSpawnFunction · 0.85
RemapItemIdxFromDiabloFunction · 0.85
UpdateHellfireFlagFunction · 0.85
NextBool32Method · 0.80
NextBytesMethod · 0.80
NextBool8Method · 0.80
SkipMethod · 0.45

Tested by

no test coverage detected