Complete.Org: Mailing Lists: Archives: freeciv-dev: February 1999:
[Freeciv-Dev] patch: cannot sabotage wonders
Home

[Freeciv-Dev] patch: cannot sabotage wonders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] patch: cannot sabotage wonders
From: Greg Wooledge <ic5035%tss1crs.amgreetings.com@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 3 Feb 1999 09:34:58 -0500

This actually started out as a bug hunt for a problem I noticed:

   Select Improvement to Sabotage

      City Production
      City Walls
      Coastal Defense
      Temple
      Sun Tzu's War Academy(O)
      Sun Tzu's War Academy(O)
      Sun Tzu's War Academy(O)
      Sun Tzu's War Academy(O)

That is, when a Spy chose to sabotage a city with multiple wonders,
the last wonder name was repeated multiple times.  This is because the
string returned by get_imp_name_ex() for wonders is stored in a static
buffer which is reused each time.  I was originally going to patch this
by using mystrdup() and free(), but then I realized that the best fix
was simpler -- wonders can't be sabotaged at all.

Then I looked at diplomat_sabotage() to double-check myself.  There are
two basic cases in this function -- a random selection, or a targeted
selection.  In the former case (used by Diplomats), wonders and the
Palace are off-limits (can't be sabotaged).  In the latter case, however,
there was no check for these limits.  I don't think this is desirable, so
I've eliminated the ability of Spies to sabotage wonders and Palaces.

I haven't actively tested this patch yet, though, since I don't have a
saved game in a convenient state.

Attachment: fc-no-sabotage-wonder.diff
Description: Text document


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