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

◆ LoadToPlayer()

void Terraria.GameContent.Creative.CreativePowerManager.LoadToPlayer ( Player player,
BinaryReader reader,
int versionGameWasLastSavedOn )
inline

Definition at line 196 of file CreativePowerManager.cs.

197 {
198 while (reader.ReadBoolean())
199 {
200 ushort key = reader.ReadUInt16();
201 if (!_powersById.TryGetValue(key, out var value))
202 {
203 break;
204 }
205 if (value is IPersistentPerPlayerContent persistentPerPlayerContent)
206 {
208 }
209 }
210 if (player.difficulty != 3)
211 {
212 ResetPowersForPlayer(player);
213 }
214 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
virtual bool ReadBoolean()
virtual ushort ReadUInt16()
Dictionary< ushort, ICreativePower > _powersById

References Terraria.GameContent.Creative.CreativePowerManager._powersById, Terraria.Player.difficulty, System.IO.BinaryReader.ReadBoolean(), System.IO.BinaryReader.ReadUInt16(), Terraria.GameContent.Creative.CreativePowerManager.ResetPowersForPlayer(), and System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue().