summaryrefslogtreecommitdiff
path: root/src/players.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/players.cpp')
-rw-r--r--src/players.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/players.cpp b/src/players.cpp
index c3bef5c3c..d8e8ad685 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -516,9 +516,9 @@ void ResetPlayerLivery(Player *p)
*/
Player *DoStartupNewPlayer(bool is_ai)
{
- Player *p = new Player(STR_SV_UNNAMED, is_ai);
+ if (!Player::CanAllocateItem()) return NULL;
- if (p == NULL) return NULL;
+ Player *p = new Player(STR_SV_UNNAMED, is_ai);
memset(&_players_ai[p->index], 0, sizeof(PlayerAI));
memset(&_players_ainew[p->index], 0, sizeof(PlayerAiNew));