- Timestamp:
- May 18, 2016, 4:56:14 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Player.cs
r273 r276 26 26 [OptionalField] 27 27 private int maxChatLength; 28 [OptionalField] 29 private uint expToNextLevel; 30 [OptionalField] 31 private int level; 32 28 33 [NonSerialized] 29 34 private ClientInfo … … 112 117 } 113 118 119 120 // Deprecated 114 121 public uint Experience { 115 122 get { 116 return experience;123 return 0; 117 124 } 118 125 } … … 120 127 public float Level { 121 128 get { 122 float perc = (float)experience / 600000;123 perc = Mathf.Sqrt (perc);124 return Mathf.Clamp ((perc * 60) + 1, 1, 60);129 float expForNextLevel = (int)Math.Min ((Progression.BaseExpToLevel * Mathf.Pow (Progression.ExpMultiplier, level + 1)), int.MaxValue); 130 float fLevel = level + 1f - ((float)expToNextLevel / expForNextLevel); 131 return fLevel; 125 132 } 126 133 } … … 176 183 177 184 public void Update (PlayerDataFile _pdf) { 178 experience = _pdf.experience; 185 experience = 0; 186 expToNextLevel = _pdf.experience; 187 level = _pdf.level; 179 188 inventory.Update (_pdf); 180 189 }
Note:
See TracChangeset
for help on using the changeset viewer.