Definition at line 307 of file PlayerIO.cs.
308 {
311 {
313 }
315 {
316 foreach (TagCompound
tag in list)
317 {
319 {
320 break;
321 }
322 string modName =
tag.GetString(
"mod");
323 ModBuff buff;
324 int type = ((modName ==
"Terraria") ?
tag.GetInt(
"id") : (ModContent.TryFind<ModBuff>(modName,
tag.GetString(
"name"),
out buff) ? buff.Type : 0));
325 if (type > 0)
326 {
330 }
331 }
332 return;
333 }
334 foreach (TagCompound
tag2 in list.Reverse())
335 {
336 if (ModContent.TryFind<ModBuff>(
tag2.GetString(
"mod"),
tag2.GetString(
"name"),
out var buff2))
337 {
339 Array.Copy(player.buffType, index, player.buffType, index + 1,
Player.MaxBuffs - index - 1);
340 Array.Copy(player.buffTime, index, player.buffTime, index + 1,
Player.MaxBuffs - index - 1);
341 player.buffType[index] =
buff2.Type;
342 player.buffTime[index] =
tag2.GetInt(
"time");
343 }
344 }
345 }
References Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.Player.MaxBuffs, and Terraria.ModLoader.ModBuff.Type.
Referenced by Terraria.ModLoader.IO.PlayerIO.Load().