Commit Graph

4206 Commits (bd65c4255f83f5954b4bb7c39549f3f324a179ef)

Author SHA1 Message Date
Per Inge Mathisen f7aba94675 When upgrading a structure module, close all open stats windows.
This fixes a long standing widget assert, and hopefully fixes 
bugs #9336: segfault, widget.c line 867 r1510 and bug #11446: 
multiplayer crash (assert) on wheel level.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4932 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 20:54:14 +00:00
Roman C a63115ec88 Fixed a crash in Aivolution.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4931 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 17:15:40 +00:00
Roman C be072337f4 Aivolution: increase number of min attackers needed to start attacking an enemy.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4930 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 16:51:23 +00:00
Roman C db9a19ae14 Balance: Bunker Buster rocket now has "Synaptic Link Data Analysis Mk3" and "HEAP Mini-Rockets" as prerequisites instead of Lancer and "HEAT Rocket Warhead Mk3".
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4928 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 16:29:44 +00:00
Per Inge Mathisen d2956ea953 Fix error message when displaying EMP VTOL bombs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4927 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 16:22:48 +00:00
Per Inge Mathisen 88d85a26f7 Remove limitation that VTOLs cannot pass over tall cliffs, and allowance that
VTOLs can fly over anything to rearm. This removes the ugly g_psDroidRoute hack.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4926 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 16:10:14 +00:00
Roman C 8cb461d222 Balance: Increased range of Rocket-MRL by 1 tile.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4924 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 16:06:21 +00:00
Roman C a81aa94067 Balance: Decreased cost of Tank Killer Hardpoint by ~8%.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4922 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:55:46 +00:00
Per Inge Mathisen 0be3471f33 Remove duplicated code from fpathGroundBlockingTile
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4921 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:26:26 +00:00
Roman C 61ce9a1dfa Swapped Tracked and Half-Tracked propulsions: anti-tank weapons do 133% damage to half-tracks and 110% to tracks.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4919 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:18:59 +00:00
Giel van Schijndel fd9b608a6c * Remove macro TERRAIN_TYPES which was just an alias for TER_MAX (and replace all instances of it with TER_MAX)
* Move some variables into a more local scope


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4918 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:12:37 +00:00
Giel van Schijndel 7b12081033 sDisplay is a member variable from BASE_OBJECT, so don't bother casting tile->psObject to a STRUCTURE* or FEATURE* before using this member variable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4917 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:04:07 +00:00
Giel van Schijndel 3a11c25d54 * Turn macros TILE_OCCUPIED, TILE_HAS_STRUCTURE, TILE_HAS_FEATURE, TILE_HAS_WALL, TILE_HIGHLIGHT, TILE_HAS_TALLSTRUCTURE and TILE_HAS_SMALLSTRUCTURE into static inline functions TileIsOccupied, TileHasStructure, TileHasFeature, TileHasWall, TileIsHighlighted, TileHasTallStructure and TileHasSmallStructure respectively
* Move the definition of MAPTILE above these ^^ macros and functions to prevent declarations problems


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4916 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 14:56:33 +00:00
Giel van Schijndel 45c2a0676c Don't check for strlcpy and strlcat in the configure script as simply #defining _XOPEN_SOURCE (what config.h does) is enough to prevent declarations of these functions from being included (thus the #inclusion of "frame.h" in strlfuncs.h should be enough (this should fix bug #11609)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4915 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 13:56:27 +00:00
Roman C 2c7d52d0c8 Fix MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:55:05 +00:00
Per Inge Mathisen 221a2cb4ee Remove MSVC support for WZ_DECL_CONST since it didn't work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4913 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:34:20 +00:00
Roman C 7f96d8ad29 Don't try to draw effect, that is used to visualize a radius, off map. This prevents an assert in map_Height().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4911 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:59:57 +00:00
Roman C 024def4cd0 Balance:
-make Scorpion slightly 4% more expensive
-cost of Dragon any Wyvern body decreased by ~10%

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4909 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:55:16 +00:00
Per Inge Mathisen 6e9732a86a WZ_DECL_CONST now implies WZ_DECL_WARN_UNUSED_RESULT and also works on MSVC.
WZ_DECL_RESTRICT now works on MSVC as well.
WZ_DECL_THREAD added, declares variables thread local, support for it made mandatory.
WZ_ASSERT_STATIC_STRING (gcc only) to assert that a string is static added.
The sstr functions now support pointer-length strings again.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4908 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:43:28 +00:00
Giel van Schijndel bedb5a77cb Remove function declarations for non-implemented functions receiveWholeDroid and sendWholeDroid
PS Thanks Troman for granting me the privilege of removing these declarations. I just love cleaning up code ;-)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4907 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 23:13:20 +00:00
Per Inge Mathisen df4e26104e Remove unused code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4906 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 22:04:05 +00:00
Roman C b32efa5ce5 Fixed vertical position of the 'ready' button.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4904 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 20:09:17 +00:00
Roman C 2e7aeb7e1e Add highlighting frame for the 'ready' button.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4902 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 18:48:19 +00:00
Roman C aa97edfd3c Add proper icons for the 'ready' buttons. Icons by elio`.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4900 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 17:43:55 +00:00
Per Inge Mathisen d5200992a1 Remove references to old bitmap font images.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4899 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 17:04:15 +00:00
Per Inge Mathisen 5fcc77fe59 Simplify fpathRoute parameters, and its beautify error log calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4898 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 11:57:54 +00:00
Giel van Schijndel 6a236994ae Move psActionTarget into a more local scope, to ease debugging of bug #11609
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4897 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 11:16:03 +00:00
Giel van Schijndel 31fda8026b Don't call function pointers when they're NULL (fixes a segfault bug that occurs when a resource type without release function couldn't be loaded)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:24:36 +00:00
Giel van Schijndel 46805bb32f Fix bug #11480:
* Don't call PHYSFS_close if our PHYSFS_file* pointer is NULL


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4895 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:17:06 +00:00
Giel van Schijndel 8997223371 Perform the actual function call of the parsing function (levParse) in doParseTest() in t1000.c rather than parse_test.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4894 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:55:24 +00:00
Giel van Schijndel ed46143437 Update svn:ignore and bugtraq:* properties on /tests/
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4893 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:38:50 +00:00
Giel van Schijndel 510b633251 * Utilise ARRAY_SIZE to determine the amount of elements in a statically sized array
* Use sizeof(*ptr) instead of sizeof(type) in malloc & memset calls


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4892 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:19:15 +00:00
Per Inge Mathisen 6f7ee5236e Remove unused aMapLinePoints global.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4891 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:10:08 +00:00
Per Inge Mathisen 1423e2d742 Add path-finding test and measurement to selftest.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4890 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:06:39 +00:00
Giel van Schijndel 03bc81c0fb #include "frame.h" in strlfuncs.h; to hopefully fix bug #11609
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4889 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:59:35 +00:00
Giel van Schijndel 0071531040 Fix several memory leaks in level_parser.y that occur when parsing errors occur:
* In case of a semantic error (i.e. we detect something is wrong in a parsing rule) deallocate the resources of our current tokens __before__ calling YYABORT
 * Only add a LEVEL_DATASET* to the psLevels list when we've fully and succesfully finished parsing of the corresponding level_entry
 * Add a bison "destructor" that handles destruction of tokens on the parsing stack when a syntax error occurs (i.e. the current tokens cannot be matched to any parsing rule)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4888 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:37:23 +00:00
Giel van Schijndel efd188a632 Call debug_exit() on exit from the parser unit test so that valgrind testing becomes easier
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4887 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:30:45 +00:00
Giel van Schijndel 006ec9e71a clean up levShutDown()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4886 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 19:51:23 +00:00
Per Inge Mathisen 76110b6156 Vastly simplify fpathGatewayRoute
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4885 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 19:03:10 +00:00
Giel van Schijndel ff89c2e63f Less leaking of memory from level_parser.y
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:58:43 +00:00
Giel van Schijndel 35d84d2fbf Add the beginnings of an external unit test framework (i.e. it doesn't run in Warzone itself, it just links to pieces of Warzone's code to test it):
* Add a new directory with unit tests (/tests/)
  * Run `make test` in this directory to execute all these unit tests and get reports from them if they fail
 * Add a single unit test to the directory which tests level_parser.y and the input it should & shouldn't accept


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4883 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:44:01 +00:00
Giel van Schijndel d722cb24bb Allow level files (*.lev) to be empty, though give a warning when they are (LOG_WARNING)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4882 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:22:59 +00:00
Per Inge Mathisen 54ce38695e Add hack check to warn against flex 2.5.34, revert requirement back to .33
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4880 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:04:08 +00:00
Giel van Schijndel 9c73cefd89 Don't ASSERT on a parsing error, use debug(LOG_ERROR, ... instead (the parser's return-value will be enough to determine that an error occurred)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4879 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 17:59:39 +00:00
Giel van Schijndel 5154d575da Assert that the pointers to strlcpy & strlcat are not NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4878 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:38:44 +00:00
Giel van Schijndel b9857f9bf9 Detect whether the OS already supplies strlcpy and strlcat and don't define our own if it does:
* Add m4 macros AC_STRLCPY_CHECK and AC_STRLCAT_CHECK for use in the autoconf script
 * Don't define our implementation when HAVE_STRLCPY or HAVE_STRLCAT is defined

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:04:20 +00:00
Giel van Schijndel 87c779278a Remove non existent files platform.h and dbghelp.h from the Code::Blocks projectfile
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4875 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 22:54:37 +00:00
Giel van Schijndel 91fb082019 Minor cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4874 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:50:30 +00:00
Giel van Schijndel d962bcbf1c * Use a nice & easy to maintain string to enum mapping-array and utilise a for-loop to fetch the correct value from it (instead of a huge amount of code repetition)
* Some const correctness

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4873 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:25:20 +00:00
Giel van Schijndel 507a1a6da2 Less bitfucking:
* Don't store whether a research item is possible in a bitflag; use a boolean instead
 * Use functions instead of macros to access research->possible

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4872 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:00:13 +00:00