12
0

Update1.0 #11

Geschlossen
YoyoNow möchte 11 Commits von Update1.0 nach master mergen
Nur Änderungen aus Commit f09c856b32 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -45,7 +45,7 @@ public class MissileWars extends JavaPlugin {
public void onLoad() {
plugin = this;
fightState = FightState.WAITING;
startTime = System.currentTimeMillis();
startTime = -1;
}
@Override
@ -87,6 +87,7 @@ public class MissileWars extends JavaPlugin {
if (fightState != FightState.WAITING) // anti dual-call
return;
fightState = FightState.FIGHTING;
startTime = System.currentTimeMillis();
StateDependent.setupState(fightState);
startTime = System.currentTimeMillis();
@ -147,6 +148,7 @@ public class MissileWars extends JavaPlugin {
* @return seconds since start
*/
public static int getFightTime() {
return Math.floorDiv((int) (System.currentTimeMillis() - startTime), 60);
if (startTime == -1) return -1;
return (int)((System.currentTimeMillis() - startTime) / 1000);
}
}