(player_new): Proper error checking. Oops, now it may return NULL.
Proper error checking in callers required. (update_wait, market_update): If player_new() returns null pointer, skip update. (player_accept): If player_new() returns null pointer, close connection.
This commit is contained in:
parent
f841200923
commit
632fbf8d12
3 changed files with 25 additions and 6 deletions
|
@ -142,6 +142,10 @@ void *argv;
|
|||
* in the land so it can finish before it yields.
|
||||
*/
|
||||
dp = player_new(0, 0);
|
||||
if (!dp) {
|
||||
logerror("can't create dummy player for update");
|
||||
continue;
|
||||
}
|
||||
stacksize = 100000 +
|
||||
/* finish_sects */ WORLD_X * WORLD_Y * (2 * sizeof(double) +
|
||||
sizeof(s_char *));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue