[Freeciv-Dev] (PR#14338) [PATCH] can't see enemies walls
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14338 >
> [jdorje - Sat Oct 15 05:01:44 2005]:
>
> In the dev version you cannot see the city walls of enemy cities.
>
> Start a game, build city walls. Look at them. Now /take another player
> and look at them. They won't be there.
Sorry, this was my fault. I suspected it so and found the reason
after some careful sprinkling of the code with printfs.
In revision 10408 I forgot to load the improvement flags from
buildings.ruleset in server/ruleset.c:
http://svn.gna.org/viewcvs/freeciv?rev=10408&view=rev
Patch attached. Limited testing showed the city walls to be visible by
other players now.
Index: server/ruleset.c
===================================================================
--- server/ruleset.c (revision 11131)
+++ server/ruleset.c (working copy)
@@ -1319,6 +1319,8 @@
for (i = 0; i < nval; i++) {
struct requirement_vector *reqs = lookup_req_list(file, sec[i], "reqs");
struct impr_type *b = get_improvement_type(i);
+ char *sval, **slist;
+ int j, nflags, ival;
item = secfile_lookup_str(file, "%s.genus", sec[i]);
b->genus = impr_genus_from_str(item);
@@ -1329,6 +1331,21 @@
exit(EXIT_FAILURE);
}
+ slist = secfile_lookup_str_vec(file, &nflags, "%s.flags", sec[i]);
+ for(j=0; j<nflags; j++) {
+ sval = slist[j];
+ if(strcmp(sval,"")==0) {
+ continue;
+ }
+ ival = impr_flag_from_str(sval);
+ if (ival==IF_LAST) {
+ freelog(LOG_ERROR, "for improvement \"%s\": bad flag name \"%s\" (%s)",
+ b->name, sval, filename);
+ }
+ b->flags |= (1<<ival);
+ }
+ free(slist);
+
requirement_vector_copy(&b->reqs, reqs);
b->obsolete_by = lookup_tech(file, sec[i], "obsolete_by",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#14338) [PATCH] can't see enemies walls,
Vasco Alexandre da Silva Costa <=
|
|