File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Intersect.Server.Core/Entities Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -1151,16 +1151,10 @@ public override void Die(bool dropItems = true, Entity killer = null)
11511151 {
11521152 if ( Options . Instance . Player . ExpLossOnDeathPercent > 0 )
11531153 {
1154- if ( Options . Instance . Player . ExpLossFromCurrentExp )
1155- {
1156- var ExpLoss = ( this . Exp * ( Options . Instance . Player . ExpLossOnDeathPercent / 100.0 ) ) ;
1157- TakeExperience ( ( long ) ExpLoss ) ;
1158- }
1159- else
1160- {
1161- var ExpLoss = ( GetExperienceToNextLevel ( this . Level ) * ( Options . Instance . Player . ExpLossOnDeathPercent / 100.0 ) ) ;
1162- TakeExperience ( ( long ) ExpLoss ) ;
1163- }
1154+ var baseExp = Options . Instance . Player . ExpLossFromCurrentExp ? Exp : GetExperienceToNextLevel ( Level ) ;
1155+ var expRatioLost = Options . Instance . Player . ExpLossOnDeathPercent / 100.0 ;
1156+ var expLost = ( long ) ( baseExp * expRatioLost ) ;
1157+ TakeExperience ( expLost ) ;
11641158 }
11651159 }
11661160 PacketSender . SendEntityDie ( this ) ;
You can’t perform that action at this time.
0 commit comments