Commit Graph

2069 Commits

Author SHA1 Message Date
5bce71d59f Make implicit switch fallthrough an error in the Xcode project and fix all places that do it
Since we can't directly use C++11 attributes, I've chosen BOOST_FALLTHROUGH to annotate intentional fallthroughs.

Thanks to @fosnola for spotting a missing break, which triggered this.
2023-01-21 22:39:33 -05:00
ALONSO Laurent
7068815cb7 boe: timer with time<=0 are empty timer 2023-01-21 22:39:33 -05:00
ALONSO Laurent
4fd9f42c8e boe.actions.cpp: try to make key work even when the talk ends 2023-01-21 22:39:33 -05:00
ALONSO Laurent
81c8f9bba5 boe.party.cpp: fix target display in pick_spell 2023-01-21 22:26:53 -05:00
ALONSO Laurent
d6d2af943c universe.cpp: protect also is_spot against hole in the universe 2023-01-21 22:25:26 -05:00
ALONSO Laurent
e36d3f4eb2 locked-door-action.xml: add b and p shortcuts 2023-01-21 22:22:56 -05:00
ALONSO Laurent
c02dde4925 talk: try to make "Go Back" and the keys work again,
shopping: try to make work again,
2023-01-21 22:21:52 -05:00
ALONSO Laurent
812410338d journal: try to delete correctly the talking notes 2023-01-21 21:02:06 -05:00
ALONSO Laurent
64f206b5be universe.cpp: correct a memory problem with is_road... 2023-01-21 20:55:46 -05:00
ALONSO Laurent
7685a2e571 special.cpp: retrieve correctly allow/deny enter in legacy scenario, 2023-01-21 20:55:43 -05:00
ALONSO Laurent
6b5cd30149 boe.infodlg.cpp: try to correct a problem when displaying notes, 2023-01-21 20:55:39 -05:00
17ad90ece1 Check for out-of-bound terrains when building roads
Thanks to @fosnola for noticing this.
2023-01-21 20:42:12 -05:00
80b6a6decf Undo e47b7e6a22
I forgot that each program already has a separate settings file. Duh!
2023-01-21 20:35:56 -05:00
584ba11a5f Apply the more advanced scaling options also to the editors 2023-01-21 20:33:28 -05:00
d88ec6a08d Fix cases of assigning get_float_pref() to a float variable
It's called "get_float_pref" because it returns a floating-point.
However, that floating-point is in double precision.
2023-01-21 20:18:16 -05:00
577ff1a405 Don't show an 'other' option for UI scale unless it's actually selected 2023-01-21 20:15:58 -05:00
ALONSO Laurent
dda95397ec UI scaling: add a different scaling for minimap + add more scaling values... 2023-01-21 19:53:27 -05:00
ALONSO Laurent
c4e9baf854 UI scaling: try to also scale the mini_map 2023-01-21 19:21:20 -05:00
6ec1b3fd45 Uncomment an error check in experience gain 2023-01-21 19:10:28 -05:00
e47b7e6a22 Allow setting UI scale and sounds differently in each program 2023-01-21 19:10:28 -05:00
ALONSO Laurent
26d2328fe7 pc/scenario editor: add a basic preferences's menu. 2023-01-21 19:10:28 -05:00
d83139eaa0 Implement exp_adj
The original source had remnants of a PC-specific experience gain adjustment, which
appeared to be intended as a debugging aid.

I've restored and implemented it, and used it on the debug party.
It doesn't necessary need to be relegated to only a debug feature, but for now, that's
good enough.
2023-01-21 18:32:50 -05:00
992cbdb22c Delete cCurTown::difficulty
It seemed like it was intended as a mirror of cTown::difficulty, yet there didn't seem to
be anything that ever wrote to it.
So I just made everything use cTown::difficulty directly instead.
2023-01-21 18:10:58 -05:00
929d012aab Fix cStrDlog potentially requesting a 0-string dialog 2023-01-21 18:03:12 -05:00
4c6296612d Add a function to wrap percentage calculations
This should help avoid issues from integer overflow (which is technically undefined behaviour)
while also allowing such issues to be addressed centrally if they still exist.
2023-01-21 17:53:06 -05:00
7b4df6edf8 Fix typo that resulted in incorrect HP restore from NPC inns 2023-01-21 17:52:23 -05:00
d7dcf24644 Fix calling restore_sp to drain SP from an affect special node
This also adds an Allow Resist flag to determine whether the target's
Mage Spells or Priest Spells skill can reduce the amount drained.

Thanks to @fosnola for spotting this issue.
2023-01-21 17:52:23 -05:00
bad804bc71 Reset end scenario flag once the scenario has ended
Thanks to @fosnola for spotting the issue
2023-01-21 17:18:31 -05:00
b929852e22 Maybe the MSVC build failure is because they have the same object name? 2023-01-21 17:01:25 -05:00
8b3f09db79 Add missing unit tests to the Xcode 4 project 2023-01-21 16:52:28 -05:00
1654ac69aa Squash a too-verbose log message 2023-01-21 16:42:54 -05:00
fb8b0d7459 Fix white space condensing not functioning when reading a scenario
Since dialogs turn off whitespace condensing, and it's a global flag,
that caused scenarios to be read with the flag disabled.
The solution is for scenarios to directly turn the flag on before reading.
2023-01-21 16:42:33 -05:00
effc355fe1 Enable the dialogs test in Xcode and fix one dialog that failed
This also makes the test itself better
2023-01-21 16:36:31 -05:00
733d6ce116 Fix scenario editor build in Xcode 2023-01-21 16:34:54 -05:00
5c0e60711c CI: Enable the mac-scons build 2023-01-21 15:55:58 -05:00
e1d6fe1d12 scons: Missed some things in the Python2to3 update 2023-01-21 15:55:58 -05:00
76ee270c6e Add some new features to our quoted string parser, and a unit test
- Now supports \n \t \f escape sequences
- Now supports strings with literal tabs
2023-01-21 15:55:58 -05:00
a93102a08f Add a file documenting the structure of the save format 2023-01-21 15:55:58 -05:00
c27403b3d7 expl is never used anywhere, so delete it
Note: This will definitely break saved games
2023-01-21 12:17:41 -05:00
17dfbded57 This should finally fix the MSVC build... 2023-01-21 11:36:33 -05:00
2090bd3e50 minor cleanup
Suggested by @fosnola.
2023-01-21 11:27:41 -05:00
5c6e34b5de Zero stuff done flags in the constructor
Thanks to @fosnola for spotting this
2023-01-21 11:10:01 -05:00
641bef9f80 gzstream: memmove is safer here
Thanks to @fosnola for spotting this.
2023-01-21 11:01:47 -05:00
ALONSO Laurent
0e77f56fbb try to correct look_outdoor_mode 2023-01-21 10:37:44 -05:00
dc716fa5e6 Don't store inactive timers in the saved game
Thanks to @fosnola for spotting this.
2023-01-21 10:28:16 -05:00
a430abbd50 Fix fields array not matching the size of the town
The fields array was fixed at 64x64, which is fine for all towns
supported in legacy BoE.

However, we intend to support even larger towns in the future,
and also it seems silly to hold so much extra space for a smaller town.

So now, the fields array is a 2D vector that matches the size of the terrain vector.
The setup array is similarly a list of 2D vectors.

This radically changes the format used to store the setup array in a saved game.
Older saves won't crash the game, but fields will be messed up or missing.
Resetting towns is recommended.
2023-01-21 00:47:35 -05:00
c7c8f3fa77 Sanity pass of saved game format
This adds several fields to the saved game format that were simply missing.
- Monster boolean flags (for summons)
- Some missing monster ability details (for summons)
- Special on talk (for creatures)
- Max SP and morale (for creatures)
- Source scenario (for encounter notes)

It also changes the default resist to 0 instead of 100, meaning that
resistances will be saved almost always, but should be loaded correctly.

The target location is no longer saved for creatures.
There was already code that nulled it out after loading,
so now that just happens during loading instead.

The town active flags (belt_present and quickfire_present)
are now set during loading instead of after loading.

This changes the save format, so there will be minor incompatibilities.
In particular, monster health won't be loaded correctly from older saves.
2023-01-20 23:51:35 -05:00
642a863594 Delete a redundant member (it's inherited from iLiving) 2023-01-20 09:55:44 -05:00
811c5d1c7c Make sure maps are updated before saving
Thanks to @fosnola for spotting the issue.
2023-01-20 09:07:48 -05:00
5cd2ced8c2 Add cParty::is_in_scenario() 2023-01-20 09:07:24 -05:00