[Freeciv-Dev] patch: cannot sabotage wonders
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
fc-no-sabotage-wonder.diff
Description: Text document
- [Freeciv-Dev] patch: cannot sabotage wonders,
Greg Wooledge <=
|
|