Commit Graph
108 Commits
Author SHA1 Message Date
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
Marco Antonio J. Costaandmajcosta 5d3cc7969f fix code that relies on transitive includes 2025-08-30 19:09:06 -03:00
BeatAroundTheBuscherandGitHub ed00830202 Fixes Upper/Lower Casing for include paths (#487)
* Fixing upper/lower case for includes

types.h, zconf.h and zlib.h were renamed so that global includes like Types.h
are not used.
2025-08-16 22:01:12 -03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Marco Antonio J. Costaandmajcosta 86ad401186 add newline at end of file where it's lacking
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.

the script:
```

find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
	isFile=$(file -0 "$file" | cut -d $'\0' -f2)
	case "$isFile" in
		(*text*)
			echo "$file is text"
			if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
				echo "" >> "$file"
			fi
			;;
		(*)
			echo "file isn't text"
			;;
	esac
done
```
2024-12-14 19:05:48 -03:00
Asdow bfb724eab9 Use SoldierID 2024-12-01 18:23:52 +02:00
Asdow d244ef4c91 use SoldierID 2024-11-30 15:25:48 +02:00
Asdow 3f4c94642e Fix compiler warnings 2024-11-20 21:04:12 +02:00
Asdow dbc4135974 Use SoldierID 2024-11-20 21:03:08 +02:00
Asdow d826491c83 Remove unused function parameter 2024-11-20 20:26:50 +02:00
Asdow 65c4cdd1d7 Suppress compiler warnings by using SoldierID::i directly 2024-11-18 23:43:13 +02:00
Asdow f49013307f Convert to SoldierID 2024-11-18 01:01:57 +02:00
Asdow ef9aa1b027 Convert to SoldierID 2024-11-17 22:29:31 +02:00
Asdow f50bdf99cc Convert to SoldierID 2024-11-17 20:41:09 +02:00
Asdow e9a13e12d8 Convert to SoldierID 2024-11-17 17:11:03 +02:00
Asdow 34f0b40f93 Convert functions and globals to SoldierID 2024-11-17 14:53:52 +02:00
Asdow 8346d5bfa1 Convert SOLDIERTYPE->ubNextToPreviousAttackerID to SoldierID 2024-11-15 22:58:25 +02:00
Asdow 131172e41a Convert SOLDIERTYPE->ubPreviousAttackerID to SoldierID 2024-11-15 22:54:44 +02:00
Asdow ee429fd1f4 Convert SOLDIERTYPE->ubAttackerID to SoldierID 2024-11-15 22:51:48 +02:00
Asdow 10250dc035 Merge branch 'master' into ExtraMercs 2024-11-09 13:44:53 +02:00
Marco Antonio Jaguaribe Costaandmajcosta 5d3118ea75 pluck multiplayer into its own lib 2023-10-23 10:36:35 -03:00
AsdowandGitHub b8a870df02 Reduce code duplication (#233)
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Add direction utility function

We have a lot of places in the code that calculate direction based on center cell coordinates, but lack a utility function for it similar to other direction methods.

* Use utility function for calculating direction

* Use ConvertGridNoToCenterCellXY

* Use utility function for direction

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY

* Remove CenterX & CenterY functions

Use ConvertGridNoToCenterCellXY instead

* Remove CenterX & CenterY calls from UB configuration

* Address review feedback

* Remove duplicate function

ConvertGridNoToCenterCellXY and ConvertMapPosToWorldTileCenter do the exact same thing

* Use PythSpacesAway instead of GetRangeFromGridNoDiff

Both functions calculate the same thing

* Remove GetRangeFromGridNoDiff

* Remove calls to abs()

The values end up being squared anyways making these unnecessary
2023-10-07 15:14:15 +03:00
Asdow 03482ffc3d Merge branch 'master' into ExtraMercs 2023-07-26 13:17:49 +03:00
majcostaandGitHub 24425a82b1 More unused stuff removal (#49)
* More unused stuff removal

delete:
- giant 'metaheaders' (JA2 All.h, Laptop All.h, etc), preferring to add #includes directly where needed
- unused ExceptionHandling and DbMan translation units
- unused WizShare.h, Bitmap.h, trle.h, video_private.h headers

* remove mentions from vc proj files too

* remove preprocessor conditionals for unused definitions

find . -iname '*.h' -o -iname '*.cpp' -exec unifdef.exe -m -UPRECOMPILED_HEADERS -UJA2_PRECOMPILED_HEADERS -UWIZ8_PRECOMPILED_HEADERS -UPRECOMPILEDHEADERS {} ';'

then manually fixed a couple files the tool errored out on

* yes, the comments too

as title
2023-01-03 15:51:48 +02:00
Asdow 1f0a8f46e8 Import changes from the local SVN working copy 2022-10-10 10:08:44 +03:00
Sevenfm 0cc70519d3 Widescreen UI patch (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2021-11-21 12:56:27 +00:00
Flugente 098dc8e280 Disease update:
- <InfectionChance_WOUND_FIRE> can cause infections when taking fire damage
- <InfectionChance_WOUND_GAS> can cause infections when taking non-fire gas damage
- <fSpecialFlagLimitedUseArms> causes the infected to be unable to use one arm
- <fSpecialFlagLimitedUseLegs> causes the infected to be unable to run, and walk and travel slowly
- JA2_options.ini option DISEASE_SEVERE_LIMITATIONS controls whether <fSpecialFlagContractDisability>, <fSpecialFlagLimitedUseArms> and <fSpecialFlagLimitedUseLegs> are used

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=22099&goto=360451&#msg_360451

- Gas damage split up in fire and non-fire damage.
- Flamethrower projectile damaged is affected by fire resistance.

Requires GameDir >= r2553.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8828 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-06-25 22:42:44 +00:00
Sevenfm f54a91718b Play grenade pin sound (supports custom grenade pin sound with <sSound> tag in Weapons.xml)
Help AI associate noise with enemy presence: 
- melee attack noise type changed to NOISE_BULLET_IMPACT
- HTH attack noise type changed to NOISE_BULLET_IMPACT
- grenade pin noise type changed to NOISE_GRENADE_IMPACT
- launcher attack noise type changed to NOISE_GUNFIRE

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8728 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2020-01-11 17:15:17 +00:00
Flugente 8c6f69fbb8 The following options has been moved from the campaign start screen to JA2_Options.ini:
- New Chance to Hit System (now NCTH (Default: FALSE))

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23855&goto=354656&#msg_354656

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8625 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-29 21:14:00 +00:00
Flugente 2dbacd32de The following options have been moved from the campaign the campaign start screen to JA2_Options.ini:
- Maximum number of IMPs (now MAX_IMP_CHARACTERS (Default: 10))
- Enemies drop all items (now DROP_ALL (Default: FALSE))
- Merc Story Backgrounds (now BACKGROUNDS (Default: TRUE))
- Food System (now FOOD (Default: FALSE))
- Improved Interrupt System (now IMPROVED_INTERRUPT_SYSTEM (Default: TRUE))
- Inventory Manipulation Costs AP (now INVENTORY_MANIPULATION_COSTS_AP (Default: FALSE))

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23855&goto=354656&#msg_354656

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8610 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2018-09-02 15:14:01 +00:00
Wanne 1e51250475 Multiplayer: Completely disabled interrupts in a COOP game, because it is still buggy. So the ALT + E workaround on the server (to give turn back to client on stuck interrupt) should not be needed anymore
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8296 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2016-09-12 18:03:19 +00:00
Flugente 929d15ec8a changed several variable names for body types to 'ubBodyType', as this is more consistent and allows wider use of macros
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-08-07 20:09:10 +00:00
Flugente b2217eaab9 Deleted Feature: The poison feature has been made obsolete by the disease feature and has been removed.
GameDir >= r2245 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7870 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-05-20 20:39:51 +00:00
Wanne deba6d7ac0 Merged from revision: 7757
Multiplayer Bugfix: Reverted the "endless interrupt bugfix" for the pure client, because it was not working correctly, and the server could not press ALT + E to give the turn back to the client, if stuck.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7758 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2015-02-28 12:54:15 +00:00
Wanne e000abcc57 Merged from revision: 7586
Multiplayer Bugfix:
- Improved (fixed) interrupt endless clock when enemy interrupts (CO-OP game) (tested by Woquit)
- Override turn (ALT + E): Now it is possible again for the server to give the turn back to itself
- Updated MP Version Number to 3.1

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7587 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-10-18 14:08:28 +00:00
Wanne 00999d673a Merged from revision: 7565
Multiplayer Bugfix: Fixed endless clock on enemy interrupt on the server, by reverting the non working interrupt fix which was introduced in revision 5623
- INFO: The endless clock on the client still occurs on certain enemy interrupts, but this can be fixed by pressing ALT + E on the server and giving the turn back to the client.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7566 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-10-14 18:22:18 +00:00
Wanne 2bbd80892c Merged from revision: 7436
- Changed MP Version to 3.0
- Changed default value for BASE_SIGHT_RANGE to 14 (as suggested by silversurfer)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7450 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-08-28 10:55:00 +00:00
Wanne f086611d21 Merged from revision: 7344
Fixes (by Buggler)
- Centered strategic screen in non-standard resolutions
- Fixed message log disappearing when clicking map border buttons
- Minor fix for increased MAX_BUILDINGS limit 

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7345 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-07-19 13:48:27 +00:00
Flugente f5dfddb0fc FixFix: non-merc planted explosives that fire fragments caused crashes. A few functions had to be fixed.
Note: keep in mind that we cannot assume that BULLET's pFirer will be valid. Check wether ubFirerID is NOBODY first.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6776 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2014-01-19 14:14:30 +00:00
Wanne 6668b31bd4 Mutliplayer: Disabled the "client interrupt fix", because it does not work (once AI stuck, you cant give the turn by pressing ALT + E on the server back to the client ...)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6707 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-12-23 10:26:01 +00:00
Flugente 4ccc6a5b2a - new feature: backgrounds allow more personalisation of mercenaries
- background feature replaces overheating on startup screen, moved overheating opion to ini

WARNING: GameDir revision >= 1748 is required.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6353 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-09-03 20:55:33 +00:00
Wanne 47b1594d53 - Multiplayer: Re-enabled the enemy interrupt fix per default (cause it seems to work better than without the fix ...)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6123 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-06-14 08:30:05 +00:00
Flugente f92f70c78d cleaned up code: various stuff (out-of-bounds, null-pointer, uninitialized vars,...) (by CleaningWoman)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6101 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-05-27 20:38:52 +00:00
Wanne cde29c1388 - MP: Removed wrong "#ifdef INTERRUPT_MP_DEADLOCK_FIX"
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6045 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-05-01 10:42:55 +00:00
Wanne fe4c6d7e8f - MP: Re-enabled the "share same FOV for friendly players" (in COOP and Team-DM), because it seems to work fine :)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6044 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-05-01 10:28:33 +00:00
Wanne 82dec9404c - MP: Moved the FOV (friendly players share same field of view) to a define ENABLE_MP_FRIENDLY_PLAYERS_SHARE_SAME_FOV (currently disabled)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6041 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-30 16:26:49 +00:00
Wanne 3e157ecfb4 - MP: Moved the update of the turnbar on interrupt to the INTERRUPT_MP_DEADLOCK_FIX define (disabled for now)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6037 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-29 19:58:17 +00:00
Wanne 4456539663 - MP: Put the interrupt fix code in a define "INTERRUPT_MP_DEADLOCK_FIX
o It seems the fix does not work 100% and if the fix code is enabled the ALT + E feature does not work correctly (for now, disabled the fix)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6036 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-29 19:45:32 +00:00
Flugente 54ffaa2624 changed a few hardcoded numbers to enums (better, but still ugly)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6029 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-04-27 22:23:04 +00:00
Wanne f914a1da77 M.E.R.C Optional Gear (by Buggler)
- Added MERC optional gear purchase
- Adopted Tais' gear cost format as previously gear cost uses MercProfiles.xml 'optional gear cost' value if hire without pressing any 'gear kit' button
- Added condition to settle bills first before hiring same merc from MERC
- Added MERC starting gear hotkey
- Fix for AIM starting gear hotkey when using old inventory
- Removed unused variable in fresh_header.h

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5780 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-01-11 20:24:36 +00:00