It is revealed, MOLLE things in 1.13 are configured in XMLs using both NAS and OAS (old attachment system) methods even if NAS is enabled in New Game Options. Given this, logic of SetAttachmentSlotsFlag() cannot be splitted onto NAS and OAS parts, and both Attachment[] and AttachmentPoints must be checked disregarding the NAS option.
AIMNAS with its ~50K elements in Attachment[] suffered of performance drop when MOLLE stuff is in the visible inventory. To resolve it the following is done:
* Introduce gMAXATTACHMENTS_READ with actual number of elements in Attachment[]; according refactoring.
* Introduce gMAXLAUNCHABLES_READ with actual number of elements in Launchable[]; according refactoring.
* Introduce std::multimap AttachmentBackmap for quick access to attachments using itemId as a key.
* Sort Attachment[] by attachmentIndex right after loading from XML. According order in XML is not needed anymore.
* Introduce FindAttachmentRange() for quick access to attachments using attachmentId as a key (binary search in Attachment[]).
In a few words, GetHelpTextForItemInLaptop(), ValidAttachment(), SetAttachmentSlotsFlag() were heavily optimized.
GetToHitBonus() expects BOOLEAN for fProneStance argument, with no comparison to ANIM_PRONE, the ubEndHeight ends up adding bipod bonuses to *all* stances
- added path to sub-directory for Extra Items
- to avoid cluttering up the parent directory when using this feature
- it allows to place extra items in sector via xml and based on difficulty level
- the new directory "ExtraItems" will contain more details on how-to-use
* Copy grenade settings from demolitions to throwing
* Fix setting strings
* Add throwing bonuses to the same spots as demolitions
* Delete grenade bonuses from Demolitions
* Update text
* Reapply throwing check
* Tooltips were shifted by one position due to wrong handling "Accuracy modifier".
* DrawAdvancedValues():
if ( iFloatModifier[0] > 1.0 || ( fComparisonMode && iComparedFloatModifier[0] > 1.0 ) )
it checks number of laser range tiles (iFloatModifier[0] > 1.0, "meters" / CELL_X_SIZE) right before actual drawing a line with values. So if someone put 1..9 into XML (<BestLaserRange>) it will not print that value. But number of "meters" was checked (like x > 0) everywhere prior to this code.
so all the code before decided to draw line with icon for laser range, but the guilty code line didn't
I suppose not to draw laser info at all if a modder screwed up <BestLaserRange> putting a 1..9 value
so all values 0..9 basically mean 0 tiles, i.e. there is no laser ability.
* Avoid using hard-coded Signal and HE mortar shell indices. This caused art.strikes malfunctioning in item mods.
* Trim max nubers of waves to duration of signal smoke. Otherwise art.strike turns into unnatural stupidity.
* If enemy AI tried to get art.strike but lacked of resources, player will not a warning anymore.
now that CI is using cmake, we can be clean up the tree quite a bit
btw, cmake can still configure for the msbuild generator for those so inclined:
create the folder, cmd to it, run `cmake [project_root_dir] -G"Visual Studio 17 2022" -A Win32 -DLanguages=ENGLISH -DApplications=JA2` once, then open the solution file using Visual Studio 2022
* Add include guard to EditorMercs.h
* bring CivGroup related symbols from Tactical over to Editor
and adjust #includes accordingly
* remove redundant #ifdef
* Add on option to start at maximum aiming level
When hovering mouse on an enemy, aiming level is started at maximum instead of no aiming when this option is toggled.
* Allow game to continue after offering to surrender to enemies
* Fix issues related to surrender and POW quests
- Quests were ended prematurely if one had prisoners in both alma and tixa
- Strategic status flags for rescue/escape were not set properly
- Only the maximum amount a prison can hold will be taken as POWs, rest of the mercs will either escape or have to fight to the death, to prevent a player having unrescuable POWs
- Capturing a mercenary had a lot of functions called that should not have been, IF the merc is not going to be captured after all
* Switch all tactical surrender calls to use one unified function
* Only mercs that are capable can escape
Incapacitated mercs left behind will die.
Should probably prioritize incapacitated mercs to be captured by the enemy to prevent needless deaths
* Combine pow quest state changes into one function
* Add JumpIntoEscapedSector to header file
* Allow enemy to demand surrender even if they already have POWs in Tixa and Alma
* Remove surrender from UB
* Address review feedback
* Remove option to disable 'Mercs Lights during Movement"
This might've cost someone some frames in 1999, but today even a 10
year old smartphone can probably run with this turned on at 1080p without
dropping a sweat
This does not remove the menu option which I plan to replace with
'Highlight Mercs' which was hidden for some reason.
'Merc Lights during Movement' is a noop now tho
* Replace 'Merc Lights during movement' with 'Highlight Mercs'
as title
* Make 'Merc Highlights' default to false
"Wtf why am I glowing?" well your problems are over
* Flashlight changes:
- Fixed the lighted area being way too large in the diagonal directions.
- Added a minimum range to simulate a flashlight user not illuminating its feet.
- Added angle based calculations instead of the hardcoded one.
* Flashlight changes, MR feedback.
Tried to stay as close as possible to ja2_2019.sln
On Visual Studio 2022 just Project -> CMake Settings for Ja2, add
the x86 configurations you want and press F7.
Below shows how the -DLanguages -DApplications switches work, If you don't
set them, the CMakeCache.txt of them will be set to ENGLISH and JA2,
respectively:
cmake [...] // nothing set, configure just JA2_ENGLISH.exe by default
cmake [...] -DApplications="JA2UB" // configures just Unfinished Business
cmake [...] build -DApplications="JA2UB;JA2UBMAPEDITOR" // Unfinished Business and UB Map Editor
cmake [...] build -DApplications="JA2UB;JA2MAPEDITOR;ALL" // ALL is in the list, configures every application
cmake [...] build -DApplications="JA2MAPEDITOR;DeathStranding" // fatal error: DeathStranding not an application
cmake [...] -DLanguages="GERMAN" // configures just German targets
cmake [...] build -DLanguages="GERMAN;ENGLISH" // German and English
cmake [...] build -DLanguages="GERMAN;ENGLISH;ALL" // ALL is in the list, configures every language
cmake [...] build -DLanguages="ENGLISH;ESPERANTO" // fatal error: ESPERANTO not supported
* 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
these three files were in UTF-16LE encoding for some reason, which led
to git treating them as binary files, which means they weren't being git
grep'd
I just converted them using iconv -f utf-16le -t utf8 [origFile] -o
[destFile]
use git show --text to view