diff ai/aihand.c ai/aihand.c --- ai/aihand.c Tue Dec 26 22:50:48 2000 +++ ai/aihand.c Mon Jan 1 15:51:12 2001 @@ -335,7 +335,7 @@ } else defender = punit; } else if (incity->shield_surplus > 0) { pack.unit_id = punit->id; - pack.city_id = incity->id; + pack.city_id = incity->orig_id; handle_unit_change_homecity(pplayer, &pack); city_refresh(pcity); freelog(LOG_VERBOSE, "Reassigning %s from %s to %s", diff ai/aiunit.c ai/aiunit.c --- ai/aiunit.c Sat Dec 30 16:18:05 2000 +++ ai/aiunit.c Mon Jan 1 15:51:12 2001 @@ -460,7 +460,7 @@ /* FIXME: it is stupid to change homecity if the unit has no homecity in advance or the new city does not have enough shields to support it */ packet.unit_id = punit->id; - packet.city_id = pcity->id; + packet.city_id = pcity->orig_id; handle_unit_change_homecity(unit_owner(punit), &packet); return 1; } @@ -1617,7 +1617,7 @@ * -AJS, 990704 */ req.unit_id = punit->id; - req.city_id = pcity->id; + req.city_id = pcity->orig_id; handle_unit_help_build_wonder(pplayer, &req); } } @@ -1643,7 +1643,7 @@ auto_settler_do_goto(pplayer,punit, pcity->x, pcity->y); } else { req.unit_id = punit->id; - req.city_id = pcity->id; + req.city_id = pcity->orig_id; handle_unit_establish_trade(pplayer, &req); } } @@ -2097,7 +2097,7 @@ if (pdiplomat->homecity != pcity->id) { /* this may be superfluous, but I like it. -AJS */ req.unit_id=pdiplomat->id; - req.city_id=pcity->id; + req.city_id=pcity->orig_id; req.name[0]='\0'; handle_unit_change_homecity(pplayer, &req); } @@ -2181,7 +2181,7 @@ did = -1; if ((dist == 1) && (pplayer->player_no != ctarget->owner)) { dact.diplomat_id=pdiplomat->id; - dact.target_id=ctarget->id; + dact.target_id=ctarget->orig_id; if (!pdiplomat->foul && diplomat_can_do_action(pdiplomat, DIPLOMAT_EMBASSY, ctarget->x, ctarget->y)) { did=pdiplomat->id; diff server/citytools.c server/citytools.c --- server/citytools.c Mon Jan 1 15:37:50 2001 +++ server/citytools.c Mon Jan 1 15:53:18 2001 @@ -1203,6 +1203,16 @@ This is fast way to check city id. */ pcity = find_city_by_id(id); if(pcity) { + + /* We will not accept anything but original id from client. + This removes some possibilities to cheat. --Caz */ + if (id != pcity->orig_id) { + freelog(LOG_ERROR, "player_find_city_by_orig_id() got current id %i " + "for %s, when original id is %i.", id, pcity->name, + pcity->orig_id); + + return 0; + } if (owner && owner->player_no != pcity->owner) return 0; return pcity;