Fix some memory leaks within Nano Games
This commit is contained in:
parent
bef370c077
commit
aee9b2986c
@ -138,7 +138,7 @@ public class GameCurrencyManager extends GameManager implements CurrencyComponen
|
|||||||
|
|
||||||
private void informRewards(Player player, boolean reward)
|
private void informRewards(Player player, boolean reward)
|
||||||
{
|
{
|
||||||
GameSessionData data = _sessionData.get(player);
|
GameSessionData data = reward ? _sessionData.remove(player) : _sessionData.get(player);
|
||||||
|
|
||||||
if (data == null || data.Games == 0)
|
if (data == null || data.Games == 0)
|
||||||
{
|
{
|
||||||
@ -202,9 +202,6 @@ public class GameCurrencyManager extends GameManager implements CurrencyComponen
|
|||||||
statsManager.incrementStat(player, "Global.GamesPlayed", gamesPlayed);
|
statsManager.incrementStat(player, "Global.GamesPlayed", gamesPlayed);
|
||||||
require(TrackManager.class).getTrack(GemCollectorTrack.class).earnedGems(player, gems);
|
require(TrackManager.class).getTrack(GemCollectorTrack.class).earnedGems(player, gems);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove from session
|
|
||||||
_sessionData.remove(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
|
@ -78,7 +78,7 @@ public class ChallengePunchAPig extends Challenge
|
|||||||
LivingEntity damagee = event.GetDamageeEntity();
|
LivingEntity damagee = event.GetDamageeEntity();
|
||||||
Player damager = event.GetDamagerPlayer(false);
|
Player damager = event.GetDamagerPlayer(false);
|
||||||
|
|
||||||
if (damagee instanceof Pig)
|
if (damagee instanceof Pig && damager != null)
|
||||||
{
|
{
|
||||||
int punched = _punched.getOrDefault(damager, 0) + 1;
|
int punched = _punched.getOrDefault(damager, 0) + 1;
|
||||||
|
|
||||||
|
@ -49,8 +49,13 @@ public class ChallengeReverseRunner extends Challenge
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Player player : _players)
|
for (Player player : _game.getAlivePlayers())
|
||||||
{
|
{
|
||||||
|
if (!isParticipating(player))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Location location = player.getLocation().add(0, 10, 0).getBlock().getLocation().add(0.5, 0, 0.5);
|
Location location = player.getLocation().add(0, 10, 0).getBlock().getLocation().add(0.5, 0, 0.5);
|
||||||
|
|
||||||
if (!inArena(location))
|
if (!inArena(location))
|
||||||
|
Loading…
Reference in New Issue
Block a user