TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SaveModBuffs()

static List< TagCompound > Terraria.ModLoader.IO.PlayerIO.SaveModBuffs ( Player player)
inlinestaticpackage

Definition at line 275 of file PlayerIO.cs.

276 {
278 for (int i = 0; i < Player.MaxBuffs; i++)
279 {
280 int buff = player.buffType[i];
281 if (buff != 0 && !Main.buffNoSave[buff])
282 {
283 if (BuffLoader.IsModBuff(buff))
284 {
285 ModBuff modBuff = BuffLoader.GetBuff(buff);
286 list.Add(new TagCompound
287 {
288 ["mod"] = modBuff.Mod.Name,
289 ["name"] = modBuff.Name,
290 ["time"] = player.buffTime[i]
291 });
292 }
293 else
294 {
295 list.Add(new TagCompound
296 {
297 ["mod"] = "Terraria",
298 ["id"] = buff,
299 ["time"] = player.buffTime[i]
300 });
301 }
302 }
303 }
304 return list;
305 }

References Terraria.Main.buffNoSave, Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.ModLoader.BuffLoader.GetBuff(), Terraria.ModLoader.BuffLoader.IsModBuff(), and Terraria.Player.MaxBuffs.

Referenced by Terraria.ModLoader.IO.PlayerIO.SaveData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: