Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] Re: (PR#13429) Move player_research to team
Home

[Freeciv-Dev] Re: (PR#13429) Move player_research to team

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mstefek@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13429) Move player_research to team
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 9 Jul 2005 13:51:27 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13429 >

Mateusz Stefek wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13429 >
> 
>>>2.  get_player_research should return NULL if the player has no team.
>>>Callers must be audited for teamless players or NULL return values.
>>
>>Why can't we assume that each players has a team?
>>An autogame with barbarians and civil war seems to work.

> 
> This patch makes sure that each player has a team. If pteam is NULL in
> team_add_player(), an empty team will be choosen.

Hmm, but each player does have a team.  If there's no team then
team_add_player is more likely not to be called rather than being called
with a NULL team.  Note that assigning a random team may not be a good
bet.  For instance savegame.c will leave teamless players without teams
(for backwards compatibility) then loop through and assign teams where
needed at the end.

-jason





[Prev in Thread] Current Thread [Next in Thread]