Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2002:
[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g
Home

[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/42492
From: rf13@xxxxxxxxxxxxxxxxx
Date: Wed, 25 Sep 2002 03:17:53 -0700

On Tue, Sep 24, 2002 at 05:09:38PM -0700, freeciv@xxxxxxxxxxxxxxxxxxxxx wrote:
> # using $FREECIV_PATH 
> /home/freeciv/.freeciv/code/installed/stable/freeciv-1.13.0+none/share/freeciv

> 366     struct city *old_pcity = player_find_city_by_id(pplayer, 
> punit->homecity);

Relevant code for 1.13.0

1.224        (kauf     27-May-02):   struct unit *punit = 
player_find_unit_by_id(pplayer, req->unit_id);
1.224        (kauf     27-May-02):   struct city *old_pcity = 
player_find_city_by_id(pplayer, punit->homecity);
1.224        (kauf     27-May-02):   struct city *new_pcity = 
player_find_city_by_id(pplayer, req->city_id);
1.224        (kauf     27-May-02): 
1.224        (kauf     27-May-02):   if(!punit || !new_pcity) {
1.224        (kauf     27-May-02):       return;
1.224        (kauf     27-May-02):   }

As you see the test is after the access.

Current code:

1.224        (kauf     27-May-02):   struct unit *punit = 
player_find_unit_by_id(pplayer, req->unit_id);
1.231        (rfalke   10-Aug-02):   struct city *old_pcity, *new_pcity =
1.231        (rfalke   10-Aug-02):       player_find_city_by_id(pplayer, 
req->city_id);
1.224        (kauf     27-May-02): 
1.231        (rfalke   10-Aug-02):   if (!punit || !new_pcity) {
1.231        (rfalke   10-Aug-02):     return;
1.224        (kauf     27-May-02):   }
1.231        (rfalke   10-Aug-02):   old_pcity = 
player_find_city_by_id(pplayer, punit->homecity);

No problem here.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/42492, rf13 <=