Fixed an issue where applying a buff to a player would bomb the player with PLAY09 deltas

This commit is contained in:
Mads Boddum
2016-03-31 10:03:22 +02:00
parent da3a8c5fe3
commit 5d4fb756f7
2 changed files with 7 additions and 10 deletions
@@ -155,11 +155,12 @@ public class PlayerObject extends IntangibleObject {
sendDelta(3, 7, title, StringType.ASCII);
}
/**
* Calling this method will update the playTime field.
* @return the amount of time this PlayerObject has played.
*/
public int getPlayTime() {
int startTime = getStartPlayTime();
int deltaTime = (int) ((System.currentTimeMillis()) - startTime);
setPlayTime((int) TimeUnit.MILLISECONDS.toSeconds(deltaTime)); // Set new time and send delta
playTime = (int) TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - getStartPlayTime()); // Set new time and send delta
return playTime;
}
@@ -167,7 +168,7 @@ public class PlayerObject extends IntangibleObject {
this.playTime = playTime;
sendDelta(3, 9, playTime);
}
public int getGcwPoints() {
return gcwPoints;
}