The attached patch fixes a bug in proj_ImpactFunc whereby it would use the radius cubed as opposed to the radius squared when doing hit-detection. Furthermore it also removes some premature optimisations (hit-box detection).
Author: EvilGuru
Signed-off-by: Dennis Schridde <devurandom@gna.org>
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6498 4a71c877-e1ca-e34f-864e-861f7616d084
The function would quite often report an already existing template while there was none.
This fixes bug #186. This fix has already been applied in the lua branch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6490 4a71c877-e1ca-e34f-864e-861f7616d084
* Code clean up
* Make countAssignedDroids const correct
* Make countAssignedDroids return the amount of artillery ''and'' VTOL droids that are assigned to a structure
* This fixes#90, patch by i-NoD, modified by me
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6464 4a71c877-e1ca-e34f-864e-861f7616d084
is thus always facing upwards. This option is now enabled by default to obtain some feedback.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6410 4a71c877-e1ca-e34f-864e-861f7616d084
* Use C89 style variable declarations (i.e. at the beginning of scope-blocks)
* Use a proper set of #include paths
This should fix#160, patch by <i-NoD> slightly modified by me (moved variable declarations to the most local scope where used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6385 4a71c877-e1ca-e34f-864e-861f7616d084
- This will result in smaller travel distances in some cases
This closes#143 ("true distance instead of manhattan distance"), patch by <mfreire> with some modifications by me
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6363 4a71c877-e1ca-e34f-864e-861f7616d084
in instead of pop in. The transparency did not play well with the distance fog and in that case the tiles fade to the fog color. All
terrain tiles are now drawn as alpha enabled textures, which could have an impact on the performance for some people. Remember this
commit when complaints about reduced performance start coming in.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6348 4a71c877-e1ca-e34f-864e-861f7616d084
it. This will make it easier to change the sky for the different areas.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6345 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of the (previous) handcrafted version for loadPropulsionStatsFromDB
* Get rid of the old (handcrafted) `propulsion` table and replace it with the autogenerated `PROPULSION` table
NOTE: Only src/data.c src/stats-db.[ch] src/stats-db2.tpl got changed manually, the other changes where generated from these
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6337 4a71c877-e1ca-e34f-864e-861f7616d084
- New enum-field level qualifier: `%string "<string to use>";`
* Use this to specify the custom strings for enum SENSOR_TYPE
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6335 4a71c877-e1ca-e34f-864e-861f7616d084
* Ignore ./src/stats-db2.tpl.sql.c from the Doxygen documentation (as it'll get included in stats-db2.c
* Generate an alphabetical "compound" index for the Doxygen documentation
* Make the typedef name of a struct, union and enum the entity's name in Doxygen
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6330 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of the previous (handcrafted) version for loadSensorStatsFromDB
* Get rid of the old `sensor` table in the database and replace it with the autogenerated `SENSOR` table
This addresses #2
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6327 4a71c877-e1ca-e34f-864e-861f7616d084
* Use the database-meta-language code generator to generate a new stats loading function: loadConstructStatsFromDB
* Add a new resource type, DBCONSTR, which uses loadConstructStatsFromDB to load the construction stats
* Employ this new type in "base"
This addresses #2
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6326 4a71c877-e1ca-e34f-864e-861f7616d084
* Change the make rules for all files produced from the database meta language such that they have the language parser and code generator as dependency as well (i.e. if they change their files will be rebuilt)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6312 4a71c877-e1ca-e34f-864e-861f7616d084
source. It looks better now as all effects are shown even for areas you officially can't see. The only disadvantage is that disabling it
again looks really bad (structures remain visible). As I do not expect a lot of people to disable God Mode, you now can not turn it off
anymore.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6307 4a71c877-e1ca-e34f-864e-861f7616d084
structures should now be smarter about their automatic targetting.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6299 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't constantly maintain a bool (bEqual) to see whether the current template is equal to the given template
- Instead "continue" and skip to the next one instead when we've determined the current template isn't equal
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6298 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix a buffer overflow in getPlayerColourName resulting from translations for player colours being larger than the string buffer that was reserved for them
- Instead just return gettext()'s return value (because "The resulting string is statically allocated and must not be modified or freed.")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6283 4a71c877-e1ca-e34f-864e-861f7616d084
* Use a single call to ssprintf to create a string instead of ssprintf followed by strcat
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6282 4a71c877-e1ca-e34f-864e-861f7616d084
size. The tile drawer was allocating and using a vertex array the size of the whole map, now it only has one big enough to fit the visible tiles.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6270 4a71c877-e1ca-e34f-864e-861f7616d084
* Rename LIST_ADDEND to LIST_APPEND (because that's what it does: append to a list)
* Clean up the assertion in LIST_REMOVE
* Prevent a potential bug in LIST_APPEND by not initialising the psNext pointer to NULL
- doesn't ever occur right now, for one simple reason: the only place where this macro is used is on a structure that's initialised with memset(0)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6260 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix several parameters that got passed wrong and didn't get caught due to the different definitions
Caught by EvilGuru
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6256 4a71c877-e1ca-e34f-864e-861f7616d084
FMV's were missing. A message "New Intelligence Report" is shown to remind people who abort the movie that they can see
it again in the intelligence screen.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6253 4a71c877-e1ca-e34f-864e-861f7616d084
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
* Lets ''not'' save on the characters required to have function names make sense
* Make DeleteButtonData a static function (because it's only used in the source file where it's defined)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6203 4a71c877-e1ca-e34f-864e-861f7616d084
* Make sure to stop the title loop ''before'' attempting to load a save game
* Restart the title loop only ''after'' we've determined that loading of the save game was unsuccessful
Stopping the title loop (stopTitleLoop()) causes resReleaseAllData to be called, which is required to make sure that the "frontend" (aka main menu) data doesn't conflict with the game data.
This fixes#121
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6202 4a71c877-e1ca-e34f-864e-861f7616d084
We do not exit() on a bad savegame file.
Instead, we go back to the title menu. (Since we have no easy way to make a pop-up requester with the current GUI code)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6187 4a71c877-e1ca-e34f-864e-861f7616d084
Prevents allowing player from having everyone on the same team.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6184 4a71c877-e1ca-e34f-864e-861f7616d084
weapon range. Patch by myself and Zarel with input from the forums. From ticket #97.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6182 4a71c877-e1ca-e34f-864e-861f7616d084
* Instead rely on setting that pointer to NULL in the client code that calls animObj_Remove in the first place
- This was already done in all but one case where animObj_Remove was called
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6180 4a71c877-e1ca-e34f-864e-861f7616d084
* Missing returns from function
* Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove unused parameters
* Fix several "comparison between signed and unsigned" warnings
* Move some variables into a more local scope
* Mark several unused parameters with WZ_DECL_UNUSED for callback functions
* Give some variables decent names (e.g. 'j' is ''not'' a good name for a variable holding a player number)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6170 4a71c877-e1ca-e34f-864e-861f7616d084
* Move these constants in the smallest scope where they're used
* Fix a "comparison between signed and unsigned" warning
* Move a variable into a more local scope
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6169 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't cast one operand in an expression to double only to use a float ("single") number as the other operand in the expression
* Use sstrcpy and sstrcat's return values to determine whether string truncation occurred
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6168 4a71c877-e1ca-e34f-864e-861f7616d084
- (true and false are even worse than magic numbers when they're used to represent non-boolean values, i.e. abused for the fact that they happen to be defined to 1 and 0 respectively.
* This change *will* affect the way how FMV subtitles are displayed; this could be considered a bugfix, or not...
- See the changes to seqdisp.c around line 680 and keep in mind that true = 1; and SEQ_TEXT_JUSTIFY = 2;
- Looking at the commented out code I think SEQ_TEXT_JUSTIFY is intented, though due to true being 1 we've effectively been using SEQ_TEXT_FOLLOW_ON instead since r1, see browser:trunk/game/src/seqDisp.c@1#L1121
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6166 4a71c877-e1ca-e34f-864e-861f7616d084
* Use this enum as parameter type instead of mixed SDWORD and BOOLs (BOOLs are serious abuse here!!!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6165 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove several unused parameters
* Fix several "comparison between signed and unsigned" warnings
* Move variables into a more local scope where possible
* Merge the conditions of some nested if-statements
* Use an enum instead of some "magically defined" macros
* Remove unused functions tooNearEdge and demoRequestStart
* Mark function findSomethingInteresting as static
* Use ARRAY_SIZE(array) instead of sizeof(array) / sizeof(array[0])
* Get rid of some unnecessary casting from float to int
* Mark several unused parameters with WZ_DECL_UNUSED for callback functions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6161 4a71c877-e1ca-e34f-864e-861f7616d084
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
* Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
* Remove redundant function prototypes
* Move variables into a more local scope where possible
* Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
* Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix several "comparison between signed and unsigned" warnings
* Use ARRAY_SIZE(array) instead of sizeof(array) / sizeof(typeof(*array))
* Const correctness
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
* Use "%u" as format specifier for unsigned integers instead of "%d"
* Remove redundant function prototypes
* Use ssprintf instead of snprintf where appropriate
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6159 4a71c877-e1ca-e34f-864e-861f7616d084
* Const correctness
* Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
* Implement hypot() and hypotf() on non-C99 systems
* Wherever the parameters to dirtyHypot() are signed: use hypotf() instead
* Move some variables in to a more local scope
* Merge the conditions of some nested if-statements
* Get rid of some stupidly named variables (tempx and tempy are ''not'' good variable names, the names should indicate ''what'' the variables contain, not for how long)
* Remove some unnecessary casting between float and [SU]DWORD
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6157 4a71c877-e1ca-e34f-864e-861f7616d084
* Const correctness
* Return as soon as we've got our result (rather than assigning to a temporary and returning only at the end of the function)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6156 4a71c877-e1ca-e34f-864e-861f7616d084
* Change dirtyHypot()'s interface to match that of hypot() (i.e. specify the coordinates relative to the origin instead of another coordinate)
* Mark dirtyHpot() as deprecated in the Doxygen documentation and suggest to use hypot() or hypotf() instead (C99 functions for which I'll provide work arounds in math-help.h soon after this commit)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6155 4a71c877-e1ca-e34f-864e-861f7616d084
* The lexers depend on the parser's headers so make sure to compile the parsers first
* Move a misplaced line-wrapping backslash in src/makefile.win32
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084
* aiexperience.[ch] was written by Troman and included in r609
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6151 4a71c877-e1ca-e34f-864e-861f7616d084
* Rewrite NETgetGameFlagsUnjoined such that it's not hardcoded for its `flag` parameter anymore
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6150 4a71c877-e1ca-e34f-864e-861f7616d084
Make sure to add the correct number of team widgets, instead of having to display MAX_PLAYERS amount.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6148 4a71c877-e1ca-e34f-864e-861f7616d084
Alliances were formed in a SP game that were not supposed to be formed as a byproduct of having game.alliance set to ALLIANCES_TEAMS in a skirmish/MP game.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6140 4a71c877-e1ca-e34f-864e-861f7616d084
Thomas Frauendorfer. Make us test validity of system component when changing
propulsion, and also avoid crashing if current weapon mode is invalid. Pach
reviewed by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6139 4a71c877-e1ca-e34f-864e-861f7616d084
a structure, which has potentially one more weapon that this. Second and more serious issue is that
if a building is demolished, it will no longer be updated in regards to dead targets.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6136 4a71c877-e1ca-e34f-864e-861f7616d084