mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 07:20:50 +01:00
Merge branch 'wired-game-fix' into 'dev'
Wired Game Fix See merge request morningstar/Arcturus-Community!252
This commit is contained in:
commit
4a3d977777
@ -122,6 +122,10 @@ public abstract class Game implements Runnable {
|
|||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
||||||
((WiredBlob) item).onGameStart(this.room);
|
((WiredBlob) item).onGameStart(this.room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (GameTeam team : this.teams.values()) {
|
||||||
|
team.resetScores();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEnd() {
|
public void onEnd() {
|
||||||
@ -137,9 +141,11 @@ public abstract class Game implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GameTeam winningTeam = null;
|
GameTeam winningTeam = null;
|
||||||
for (GameTeam team : this.teams.values()) {
|
if(totalPointsGained > 0) {
|
||||||
if (winningTeam == null || team.getTotalScore() > winningTeam.getTotalScore()) {
|
for (GameTeam team : this.teams.values()) {
|
||||||
winningTeam = team;
|
if (winningTeam == null || team.getTotalScore() > winningTeam.getTotalScore()) {
|
||||||
|
winningTeam = team;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +172,7 @@ public abstract class Game implements Runnable {
|
|||||||
WiredHandler.handleCustomTrigger(WiredTriggerTeamLoses.class, player.getHabbo().getRoomUnit(), this.room, new Object[]{this});
|
WiredHandler.handleCustomTrigger(WiredTriggerTeamLoses.class, player.getHabbo().getRoomUnit(), this.room, new Object[]{this});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (team.getMembers().size() > 0) {
|
if (team.getMembers().size() > 0 && team.getTotalScore() > 0) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
||||||
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), team.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), team.getTotalScore(), false, Emulator.getIntUnixTimestamp()));
|
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), team.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), team.getTotalScore(), false, Emulator.getIntUnixTimestamp()));
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,8 @@ public class GameTeam {
|
|||||||
|
|
||||||
player.reset();
|
player.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.teamScore = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user