[Freeciv-Dev] conquer city, owner doesn't change (PR#466)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Full_Name: Jeff Mallatt
Version: Latest CVS
Distribution: Built from source
Client: Both (or N/A)
OS: Linux (Red Hat 5.0)
Submission from: (NULL) (205.181.148.180)
Submitted by: jjm
I walked into an empty city, but it remained owned by the enemy!
Problem is that move_unit() calls handle_move_consequences() [this is
the only place that handle_move_consequences() is called] which calls
handle_unit_enter_city() [this is the only place that
handle_unit_enter_city() is called]. Okay, move_unit() is commented
as performing "No checks whatsoever!". However, handle_unit_enter_city()
performs a check! It checks to see if the attacker is at war with the
target city. If not, it doesn't do the work to transfer the city. But,
move_unit() continues to go ahead and move the attacking unit into the
city.
This patch removes the check from handle_unit_enter_city() -- any checks
must be performed by routines that call move_unit().
Also, the comment at the head of move_unit() was misleading, so I changed
it.
diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/server/unitfunc.c
freeciv/server/unitfunc.c
--- FreecivCVS/server/unitfunc.c Sun Jul 9 21:49:12 2000
+++ freeciv/server/unitfunc.c Fri Jul 21 16:27:34 2000
@@ -3471,8 +3471,7 @@
/**************************************************************************
Moves a unit. No checks whatsoever! This is meant as a practical function
-for other functions like handle_unit_move_consequences and do_airline,
-who do the checking themselves.
+for other functions, like do_airline, which do the checking themselves.
If you move a unit you should always use this function, as it also sets the
transported_by unit field correctly.
take_from_land is only relevant if you have set transport_units.
diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/server/unithand.c
freeciv/server/unithand.c
--- FreecivCVS/server/unithand.c Sun Jul 9 16:36:46 2000
+++ freeciv/server/unithand.c Fri Jul 21 16:03:06 2000
@@ -1166,9 +1166,6 @@
struct player *cplayer;
struct city *pnewcity;
- if (!players_at_war(pplayer->player_no, pcity->owner))
- return;
-
cplayer = city_owner(pcity);
/* If a capital is captured, then spark off a civil war
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] conquer city, owner doesn't change (PR#466),
jjm <=
|
|