Commit Graph
1201 Commits
Author SHA1 Message Date
steph-pgandmajcosta b19efcf1b4 Make disease healing a highest prior 2025-10-13 16:19:44 -03:00
Asdow 584f6b47e6 Supply ProfileID to LUA scripts instead of SoldierID
Lua scripts expect to receive the same profileID value back from l_FindSolderByProfileID() that is supplied to it on the script side. This is a bit suboptimal as we constantly keep searching for the correct soldier on different calls to C++ side with the way it works now.
2025-10-11 11:43:37 +03:00
Marco Antonio J. Costaandmajcosta 3d29eff4d8 use FormatMoney everywhere 2025-10-08 05:36:37 -03:00
Marco Antonio J. Costaandmajcosta 86ec94b40a stop using sATMText for "Insufficient Funds" message
it is about to go
2025-10-08 03:07:23 -03:00
Asdow da83c6a557 Fix power gen fan sound
* Stop fan sound when switching sector
* Start fan sound when loading a save where current sector is power gen sector
2025-10-06 22:09:39 +03:00
Asdow 710941edd3 Dynamically adjust contract box position
Create contract renewal box right next to mouse position. Small QoL change to have the box closer.
2025-10-03 23:47:15 +03:00
Asdow 0b0fffa21d Improve multiselection contract renewal
* Contract duration lines are greyed out if the player lacks funds
*Selecting a mix of AIM and other merc types allows renewing contracts for selected AIM mercs
* Multiselection of only mercs whose contracts are not renewable (IMPs, rebels, etc) will have greyed out contract lines
2025-10-03 23:47:15 +03:00
Asdow e1acf181df Add FIXME 2025-09-29 11:58:55 +03:00
Asdow 0f8c14e72e Remove FindSoldierByProfileID_()
All the calls where this was used are functionally identical when we just supply UID to the original FindSoldierByProfileID() call with fPlayerMercsOnly set to FALSE
2025-09-29 11:58:55 +03:00
Asdow ecea18f57c Add FIXME to l_ActionInProgress 2025-09-29 11:58:55 +03:00
Asdow e63e936715 Clean up
* Removed superfluous for-if loops
* Wrapped function contents inside if(lua_gettop(L)) scopes similar to other, already fixed functions
* Harmonized whitespace
* Added FIXMEs to two unfinished functions
2025-09-29 11:58:55 +03:00
Asdow a15ed3aceb Fix l_SoldierGiveItem(lua_State* L)
Don't use SoldierID when matching for profile id
2025-09-29 11:58:55 +03:00
Asdow 0cb13650ed Fix whitespace formatting 2025-09-29 11:58:55 +03:00
Asdow 601ef4dc30 Remove duplicate includes 2025-09-29 11:58:55 +03:00
Asdow 8fa2189a66 Fix schedule compatibility between map versions 7 & 8 2025-09-28 10:35:13 +03:00
Asdow 6c42f222e1 Fix PBI when enemy attacks starting sector in tactical view
When enemy attacks the starting sector and player is in tactical view. We go from tactical to strategic screen to show the prebattle interface instead of staying in tactical. The game errors on the sector assert when trying to draw the glowing red locator around the sector just before displaying the prebattle interface.

Normally the sector gets set properly when compressing time for the first time in a new game start but due to UB going into playing the intro video, it skips the call to HandleTimeCompressWithTeamJackedInAndGearedToGo() that would eventually set it. Neither can we rely on setting the sector when initiating the prebattle interface since MapScreenHandle() tries to display the locator before the PBI gets initialized.
2025-09-27 01:01:23 +03:00
Asdow f5a7c32bff Use SoldierID instead of pSoldier
ContinueDialogue was possible to be called with pSoldier that isn't null but is not valid pointer to MercPtrs array resulting in debugger catching an illegal memory access.
2025-09-25 22:47:51 +03:00
Asdow 82aca548f5 Merge branch 'master' into ExtraMercs 2025-09-24 16:14:10 +03:00
Marco Antonio J. Costaandmajcosta 4ec012ce7b fix bug where combat doesn't end on team retreat
fixes issue #498 where retreating from combat in a sector that has a merc
inbound via the airdrop marker causes combat not to end

the reason this fails is that a the inbound soldier counts as being in
the sector being retreated from, even though he isn't

I add a check for `MercPtrs[i]->bInSector` so this doesn't happen

that way the function doesn't leave early and CheckForEndOfCombatMode is
reached
2025-09-11 22:00:32 -03:00
Marco Antonio J. Costaandmajcosta ac59eba898 get rid of unnecessary #defines 2025-09-05 20:31:11 -03:00
Marco Antonio J. Costaandmajcosta 7d9cd87da8 fully externalize bQueenLosingControlOfSector 2025-09-02 20:01:47 -03:00
Buscherandmajcosta 1004ab6c8c Added Right Click to time compression to fast forward a single hour 2025-08-24 15:06:10 -03:00
Marco Antonio J. Costaandmajcosta 3c44f133fd Actually fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected 2025-08-24 07:39:00 -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
BeatAroundTheBuscherandGitHub e9b12908f7 ASD/ARC: Fix Error by One in gasCan Vector (#472)
* ASD/ARC: Fix Error by One in gasCan Vector

* Add size check for the gasCan vector as part of ARC

* Remove unused Vectors for ARC
2025-08-15 18:40:43 -07:00
Marco Antonio J. Costaandmajcosta 616d9a08e6 Fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected 2025-08-12 23:18:49 -03:00
Asdow c62d767622 Update to Master 2025-08-08 18:00:31 +03:00
Asdow d078a3439f Fix squad movement popupbox for increased squads 2025-08-08 17:01:13 +03:00
Asdow 9b83d6a3bc Increase squad amount to 40 2025-08-08 16:39:52 +03:00
Asdow c3a34a660d Check squads are on the same level 2025-08-07 22:02:49 +03:00
AsdowandGitHub 7bb7c54317 Guard against integer underflow (#462) 2025-07-20 17:30:22 -07:00
Asdow 49a56d01ac Load correct militia icons for 720p resolution 2025-07-08 20:21:54 +03:00
Asdow 9d1e9e8948 Fix line highlighting 2025-06-27 20:28:15 +03:00
Asdow 5e2c61ef12 Externalized UB bloodcat quest sector 2025-06-25 22:54:53 +03:00
Asdow a1bb85ca95 Externalize fan exitgrid location in the source sector 2025-06-24 22:54:44 +03:00
Asdow c02bbc90cb Fix helicopter for UB
No need to force an assert error here. We can simply ignore the meanwhile scene just like all the others.
2025-06-18 22:58:17 +03:00
Asdow 8dcb431ef2 Use (0,0) sector coordinates as unused cache
Makes the comment in Mod_Settings.ini valid advice
2025-04-17 23:51:44 +03:00
Asdow 8f98a9b985 Move UpdateAirspaceControl() out of #ifdef
Fixes UB not updating samsite airspace correctly after battle
2025-04-16 01:28:07 +03:00
Asdow 36a84ffe59 Remove pSecondColumnString
* Use the new columns added to Text instead
* Changed most functions to allow choosing a column
* Removed unneeded SecondColumn specific functions to lessen code duplication
* Lots of formatting changes to Popupbox.cpp, indentation was messed up in majority of the functions
2025-04-13 22:26:32 +03:00
Asdow 865288e622 Implement multicolumn popupbox
Mainly aimed for strategic movement popup box to accommodate increased team sizes
2025-04-13 19:11:45 +03:00
Asdow da3c3bace8 Use mouse position for squad movement popup box initial location 2025-04-09 23:11:11 +03:00
Asdow ec4dc8b058 Provide gMapViewRegion through mapscreen.h 2025-04-09 23:10:32 +03:00
Asdow 07320ba996 Limit TeamList mouseregions to correct amount 2025-04-09 21:33:28 +03:00
Asdow fffb3a45fb Remove 8bit mode
Obsolete and doesn't work

* Remove gbPixelDepth
* Remove 8-bit to 8-bit blitters
* FileNameForBPP now only calls strcopy
2025-02-24 21:42:36 +02:00
Asdow dcf202990f Remove duplicate header includes 2025-01-05 17:08:02 +02:00
Asdow db40cd433e Move mapscreen bottom coordinates' initialization
Fixes radar map's initial  position in strategic screen being in the top right corner.
2025-01-05 17:08:02 +02:00
Marco Antonio J. Costa 70f09471c2 just cast g_lang into lua's language code
because magically I got the enum order right first try
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa d008d10b31 Replace a ton of trivial #ifdefs with runtime checks
This one is big, but unless I missed something, should be all be
trivial.

scripted-diff with the following, then manually tweaked whatever needed:
```

if [ $# -ne 3 ]; then
    echo "Usage: $0 '<pattern>' '<replacement>' '<filename>'"
    exit 1
fi

pattern="$1"
replacement="$2"
filename="$3"

if [ ! -f "$filename" ]; then
    echo "Error: File $filename does not exist."
    exit 1
fi

sed -i '/'"$pattern"'/ {
    :loop
    $ !{
        N
        /'"$pattern"'.*\n.*#endif/ {
            s/'"$pattern"'/'"$replacement"'/
            s/#else/} else {/
            s/#endif/}/
            P
            D
        }
        /'"$pattern"'/ b loop
    }
}' "$filename"

echo "Replacement complete in $filename"
```

h/t to Grok2 for the sed command
2024-12-31 16:28:44 -03:00
Marco Antonio J. Costa 5d19c1fe25 make conditional CHINESE preprocessor def into global constant 2024-12-31 16:28:44 -03:00
Asdow 5b966b4df9 Provide MAX_TACTICAL_ENEMIES to lua 2024-12-24 00:16:09 +02:00