[Freeciv-Dev] Re: patch 2: unique and gameloss flags for units (PR#1324)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Mar 12, 2002 at 05:32:06PM -0800, Per I. Mathisen wrote:
> static const char *role_names[] = {
> "FirstBuild", "Explorer", "Hut", "HutTech", "Partisan",
> @@ -424,6 +424,11 @@
> return FALSE;
> if (get_invention(p,unit_types[id].tech_requirement)!=TECH_KNOWN)
> return FALSE;
> + if (unit_type_flag(id, F_UNIQUE)) {
> + unit_list_iterate_safe(p->units, punit) {
> + if (punit->type == id) return FALSE;
Please add {}. Why do you use unit_list_iterate_safe here?
> + } unit_list_iterate_safe_end;
> + }
> return TRUE;
> }
> + F_UNIQUE, /* A player can only build one of this unit */
F_UNIQUE, /* A player can only build one unit of this type */
> + /* check if this unit had F_GAMELOSS flag */
> + if (unit_flag(punit, F_GAMELOSS)) {
> + notify_conn_ex(&game.est_connections, punit->x, punit->y, E_UNIT_LOST,
> + _("Unable to defend %s, %s has lost the game."),
> + unit_name(punit->type), unit_owner(punit)->name);
> + notify_player(unit_owner(punit), "Losing %s meant losing the game! Be
> more careful"
> + " next time!", unit_name(punit->type));
Add _()
> + unit_owner(punit)->is_alive = FALSE;
I'm not sure about the consequence of this (which players owns the
remaining units/cities now). We could:
- destroy/raze all cities/units
- install a new AI and transfer cities/units
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"The very concept of PNP is a lovely dream that simply does not translate to
reality. The confusion of manually doing stuff is nothing compared to the
confusion of computers trying to do stuff and getting it wrong, which they
gleefully do with great enthusiasm."
-- Jinx Tigr in the SDM
|
|