fix for "No Faction" player count always returning 0
This commit is contained in:
parent
cddaa73948
commit
4da15abb06
@ -213,7 +213,7 @@ public class Faction {
|
|||||||
|
|
||||||
public ArrayList<FPlayer> getFPlayers() {
|
public ArrayList<FPlayer> getFPlayers() {
|
||||||
ArrayList<FPlayer> ret = new ArrayList<FPlayer>();
|
ArrayList<FPlayer> ret = new ArrayList<FPlayer>();
|
||||||
if (id <= 0)
|
if (id < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (FPlayer fplayer : FPlayer.getAll()) {
|
for (FPlayer fplayer : FPlayer.getAll()) {
|
||||||
@ -227,7 +227,7 @@ public class Faction {
|
|||||||
|
|
||||||
public ArrayList<FPlayer> getFPlayersWhereOnline(boolean online) {
|
public ArrayList<FPlayer> getFPlayersWhereOnline(boolean online) {
|
||||||
ArrayList<FPlayer> ret = new ArrayList<FPlayer>();
|
ArrayList<FPlayer> ret = new ArrayList<FPlayer>();
|
||||||
if (id <= 0)
|
if (id < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (FPlayer fplayer : FPlayer.getAll()) {
|
for (FPlayer fplayer : FPlayer.getAll()) {
|
||||||
@ -255,7 +255,7 @@ public class Faction {
|
|||||||
|
|
||||||
public ArrayList<Player> getOnlinePlayers() {
|
public ArrayList<Player> getOnlinePlayers() {
|
||||||
ArrayList<Player> ret = new ArrayList<Player>();
|
ArrayList<Player> ret = new ArrayList<Player>();
|
||||||
if (id <= 0)
|
if (id < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (Player player: Factions.instance.getServer().getOnlinePlayers()) {
|
for (Player player: Factions.instance.getServer().getOnlinePlayers()) {
|
||||||
@ -271,7 +271,7 @@ public class Faction {
|
|||||||
// slightly faster check than getOnlinePlayers() if you just want to see if there are any players online
|
// slightly faster check than getOnlinePlayers() if you just want to see if there are any players online
|
||||||
public boolean HasPlayersOnline() {
|
public boolean HasPlayersOnline() {
|
||||||
// only real factions can have players online, not wilderness / safe zone / war zone
|
// only real factions can have players online, not wilderness / safe zone / war zone
|
||||||
if (id <= 0)
|
if (id < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (Player player: Factions.instance.getServer().getOnlinePlayers()) {
|
for (Player player: Factions.instance.getServer().getOnlinePlayers()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user