Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Commit

Permalink
Simplify bztk_isValidPlayerID
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Jan 15, 2017
1 parent 015c6e6 commit b69b9e6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bzToolkitAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ bz_APIIntList* bztk_getTeamPlayerIndexList(bz_eTeamType _team)
{
if (bz_getPlayerTeam(playerList->get(i)) == _team)
{
resp->push_back(playerList->get(i));
resp->push_back(playerList->get(i));
}
}

Expand All @@ -311,11 +311,7 @@ bz_APIIntList* bztk_getTeamPlayerIndexList(bz_eTeamType _team)

bool bztk_isValidPlayerID(int playerID)
{
// Use another smart pointer so we don't forget about freeing up memory
std::shared_ptr<bz_BasePlayerRecord> playerData(bz_getPlayerByIndex(playerID));

// If the pointer doesn't exist, that means the playerID does not exist
return (playerData) ? true : false;
return bz_getPlayerByIndex(playerID);
}

int bztk_randomPlayer(bz_eTeamType _team = eNoTeam)
Expand Down

0 comments on commit b69b9e6

Please sign in to comment.