Store death points on logout.

This commit is contained in:
MobiusDevelopment
2020-12-17 22:16:58 +00:00
parent 2d145c44a5
commit b3e3c1bb95
3 changed files with 8 additions and 1 deletions

View File

@@ -10766,6 +10766,12 @@ public class PlayerInstance extends Playable
LOGGER.log(Level.SEVERE, "deleteMe()", e);
}
// Store death points.
if (_isDeathKnight)
{
getVariables().set(PlayerVariables.DEATH_POINT_COUNT, _deathPoints);
}
// Make sure player variables are stored.
getVariables().storeMe();

View File

@@ -63,6 +63,7 @@ public class PlayerVariables extends AbstractVariables
public static final String FORTUNE_TELLING_BLACK_CAT_VARIABLE = "FortuneTellingBlackCat";
public static final String DELUSION_RETURN = "DELUSION_RETURN";
public static final String HUNTING_ZONE_RESET_TIME = "HUNTING_ZONE_RESET_TIME_";
public static final String DEATH_POINT_COUNT = "DEATH_POINT_COUNT";
public static final String STAT_POINTS = "STAT_POINTS";
public static final String STAT_STR = "STAT_STR";
public static final String STAT_DEX = "STAT_DEX";

View File

@@ -653,7 +653,7 @@ public class EnterWorld implements IClientIncomingPacket
{
// Send twice.
player.setDeathPoints(500);
player.setDeathPoints(0); // TODO: Store death point values?
player.setDeathPoints(player.getVariables().getInt(PlayerVariables.DEATH_POINT_COUNT, 0));
}
if (Config.ENABLE_ATTENDANCE_REWARDS)