[Freeciv-Dev] (PR#11377) remove some specialist references
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11377 >
This patch removes a few simple references to specialist types (SP_ELVIS).
In one place SP_TAXMAN was used for newly-added-to-cities. This may
have been a bug because the city might not be big enough for taxmen.
Although auto_arrange_workers is called immediately afterwards, it does
mean the city is in an "incorrect" state for a while.
jason
Index: common/city.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.c,v
retrieving revision 1.272
diff -u -r1.272 city.c
--- common/city.c 6 Dec 2004 18:01:14 -0000 1.272
+++ common/city.c 6 Dec 2004 18:54:28 -0000
@@ -2464,7 +2464,7 @@
specialist_type_iterate(sp) {
pcity->specialists[sp] = 0;
} specialist_type_iterate_end;
- pcity->specialists[SP_ELVIS] = 1;
+ pcity->specialists[DEFAULT_SPECIALIST] = 1;
pcity->ppl_happy[4] = 0;
pcity->ppl_content[4] = 1;
pcity->ppl_unhappy[4] = 0;
Index: common/aicore/cm.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/cm.c,v
retrieving revision 1.50
diff -u -r1.50 cm.c
--- common/aicore/cm.c 2 Dec 2004 10:20:30 -0000 1.50
+++ common/aicore/cm.c 6 Dec 2004 18:54:28 -0000
@@ -2053,10 +2053,8 @@
freelog(LOG_NORMAL, "print_city(city='%s'(id=%d))",
pcity->name, pcity->id);
freelog(LOG_NORMAL,
- " size=%d, entertainers=%d, scientists=%d, taxmen=%d",
- pcity->size, pcity->specialists[SP_ELVIS],
- pcity->specialists[SP_SCIENTIST],
- pcity->specialists[SP_TAXMAN]);
+ " size=%d, specialists=%s",
+ pcity->size, specialists_string(pcity->specialists));
freelog(LOG_NORMAL, " workers at:");
my_city_map_iterate(pcity, x, y) {
if (pcity->city_map[x][y] == C_TILE_WORKER) {
Index: server/cityhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityhand.c,v
retrieving revision 1.137
diff -u -r1.137 cityhand.c
--- server/cityhand.c 29 Sep 2004 02:24:23 -0000 1.137
+++ server/cityhand.c 6 Dec 2004 18:54:28 -0000
@@ -106,7 +106,7 @@
}
if (is_worker_here(pcity, worker_x, worker_y)) {
server_remove_worker_city(pcity, worker_x, worker_y);
- pcity->specialists[SP_ELVIS]++;
+ pcity->specialists[DEFAULT_SPECIALIST]++;
city_refresh(pcity);
sync_cities();
} else {
Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.287
diff -u -r1.287 citytools.c
--- server/citytools.c 5 Dec 2004 13:00:16 -0000 1.287
+++ server/citytools.c 6 Dec 2004 18:54:29 -0000
@@ -1544,9 +1544,9 @@
packet->ppl_unhappy[i]=pcity->ppl_unhappy[i];
packet->ppl_angry[i]=pcity->ppl_angry[i];
}
- packet->specialists[SP_ELVIS] = pcity->specialists[SP_ELVIS];
- packet->specialists[SP_SCIENTIST] = pcity->specialists[SP_SCIENTIST];
- packet->specialists[SP_TAXMAN] = pcity->specialists[SP_TAXMAN];
+ specialist_type_iterate(sp) {
+ packet->specialists[sp] = pcity->specialists[sp];
+ } specialist_type_iterate_end;
for (i = 0; i < NUM_TRADEROUTES; i++) {
packet->trade[i]=pcity->trade[i];
packet->trade_value[i]=pcity->trade_value[i];
@@ -2001,7 +2001,7 @@
case C_TILE_WORKER:
if (!is_available) {
server_set_tile_city(pcity, city_x, city_y, C_TILE_UNAVAILABLE);
- pcity->specialists[SP_ELVIS]++; /* keep city sanity */
+ pcity->specialists[DEFAULT_SPECIALIST]++; /* keep city sanity */
auto_arrange_workers(pcity); /* will place the displaced */
city_refresh(pcity);
send_city_info(NULL, pcity);
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.55
diff -u -r1.55 sanitycheck.c
--- server/sanitycheck.c 22 Nov 2004 07:12:39 -0000 1.55
+++ server/sanitycheck.c 6 Dec 2004 18:54:29 -0000
@@ -258,9 +258,10 @@
}
} city_map_iterate_end;
if (workers + city_specialists(pcity) != pcity->size + 1) {
- die("%s is illegal (size%d w%d e%d t%d s%d) in %s line %d",
- pcity->name, pcity->size, workers, pcity->specialists[SP_ELVIS],
- pcity->specialists[SP_TAXMAN], pcity->specialists[SP_SCIENTIST], file,
line);
+ die("%s is illegal (size%d w%d s%s) in %s line %d",
+ pcity->name, pcity->size, workers,
+ specialists_string(pcity->specialists), file, line);
+
}
}
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.210
diff -u -r1.210 savegame.c
--- server/savegame.c 30 Nov 2004 08:37:03 -0000 1.210
+++ server/savegame.c 6 Dec 2004 18:54:30 -0000
@@ -2106,8 +2106,8 @@
if (ptile->worked) {
/* oops, inconsistent savegame; minimal fix: */
freelog(LOG_VERBOSE, "Inconsistent worked for %s (%d,%d), "
- "converting to elvis", pcity->name, x, y);
- pcity->specialists[SP_ELVIS]++;
+ "converting to specialist", pcity->name, x, y);
+ pcity->specialists[DEFAULT_SPECIALIST]++;
set_worker_city(pcity, x, y, C_TILE_UNAVAILABLE);
} else {
set_worker_city(pcity, x, y, C_TILE_WORKER);
@@ -3009,7 +3009,7 @@
if (!res) {
struct tile *ptile;
- pcity->specialists[SP_ELVIS]++;
+ pcity->specialists[DEFAULT_SPECIALIST]++;
set_worker_city(pcity, x, y, C_TILE_UNAVAILABLE);
freelog(LOG_DEBUG, "Worked tile was unavailable!");
Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.316
diff -u -r1.316 unithand.c
--- server/unithand.c 4 Dec 2004 04:44:08 -0000 1.316
+++ server/unithand.c 6 Dec 2004 18:54:31 -0000
@@ -455,7 +455,7 @@
assert(unit_pop_value(punit->type) > 0);
pcity->size += unit_pop_value(punit->type);
/* Make the new people something, otherwise city fails the checks */
- pcity->specialists[SP_TAXMAN] += unit_pop_value(punit->type);
+ pcity->specialists[DEFAULT_SPECIALIST] += unit_pop_value(punit->type);
auto_arrange_workers(pcity);
wipe_unit(punit);
send_city_info(NULL, pcity);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#11377) remove some specialist references,
Jason Short <=
|
|