Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9635) "show forests" won't work
Home

[Freeciv-Dev] (PR#9635) "show forests" won't work

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9635) "show forests" won't work
From: "Gregor Richards" <akaquinn@xxxxxxxxxxx>
Date: Sun, 8 Aug 2004 11:12:38 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9635 >

With a little bit less CVS garbage, and a bit more, uhh, patch. 
? fixlevelsbug.diff
Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.334
diff -u -r1.334 stdinhand.c
--- server/stdinhand.c  31 Jul 2004 03:57:26 -0000      1.334
+++ server/stdinhand.c  8 Aug 2004 18:10:46 -0000
@@ -3105,12 +3105,14 @@
 
   if (*command != '\0') {
     cmd=lookup_option(command);
-    if (cmd >= 0 && !may_view_option(caller, cmd)) {
+    if (cmd >= 0) {
       level = SSET_NONE;
-      cmd_reply(CMD_SHOW, caller, C_FAIL,
-               _("Sorry, you do not have access to view option '%s'."),
-               command);
-      return FALSE;
+      if (!may_view_option(caller, cmd)) {
+        cmd_reply(CMD_SHOW, caller, C_FAIL,
+                 _("Sorry, you do not have access to view option '%s'."),
+                 command);
+        return FALSE;
+      }
     }
     if (cmd == -1) {
       cmd_reply(CMD_SHOW, caller, C_FAIL, _("Unknown option '%s'."), command);
@@ -3172,7 +3174,7 @@
       struct settings_s *op = &settings[i];
       int len = 0;
 
-      if (level == SSET_ALL || op->level == level) {
+      if (level == SSET_ALL || op->level == level || cmd >= 0) {
         switch (op->type) {
         case SSET_BOOL:
          len = my_snprintf(buf, sizeof(buf),

[Prev in Thread] Current Thread [Next in Thread]