This calculation is wrong.
This is resulting a opposite value (negative becomes positive, and the other way around).
Proof:
Lets say:
iExpChange = 100
iOldExp = 1000
g_iPlayerInfo[iClient].iStats[ST_EXP] = 1000 + 100+ 100 is because iExpChange is added to this variable in line 189:
if((g_iPlayerInfo[iClient].iStats[ST_EXP] += iExpChange) < iExpMin)
This makes the above calculation evaluate to this:
g_iPlayerInfo[iClient].iRoundExp += iExpChange = 1000 - 1100;
Making iExpChange be equal -100 and wrongly decreasing g_iPlayerInfo[iClient].iRoundExp also by this variable value.
g_iPlayerInfo[iClient].iRoundExp += iExpChange = iOldExp - g_iPlayerInfo[iClient].iStats[ST_EXP];
This calculation is wrong. This is resulting a opposite value (negative becomes positive, and the other way around).
Proof:
Lets say:
iExpChange = 100
iOldExp = 1000
g_iPlayerInfo[iClient].iStats[ST_EXP] = 1000 + 100
+ 100
is becauseiExpChange
is added to this variable in line 189:if((g_iPlayerInfo[iClient].iStats[ST_EXP] += iExpChange) < iExpMin)
This makes the above calculation evaluate to this:
g_iPlayerInfo[iClient].iRoundExp += iExpChange = 1000 - 1100;
MakingiExpChange
be equal -100 and wrongly decreasingg_iPlayerInfo[iClient].iRoundExp
also by this variable value.