Commit Graph

2042 Commits

Author SHA1 Message Date
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
ALONSO Laurent
b896abf29b try to avoid loosing boat/horse outdoor... nature... 2023-01-19 21:33:35 -05:00
68ef066dca Some adjustments to item interesting strings
For weapons, negative bonus is now shown as "- 2" instead of as "+ -2".

For armour, the bonus is now accounted for and the numbers should match
what is actually calculated in damage_pc().

Thanks to @fosnola for noticing the armour discrepancy.
2023-01-19 09:52:01 -05:00
2d1bbe0058 Move get_item_interesting_string() into the cItem class 2023-01-19 09:32:07 -05:00
7dcaa7d332 Clean up damage_pc 2023-01-19 09:25:16 -05:00
ffa09bb10c Fix inconsistent function signatures 2023-01-19 08:48:08 -05:00
c7012f5db3 Clean up update_explored - no need for so many variables 2023-01-18 21:44:50 -05:00
d696fa7edb Another try at fixing the MSVC project file 2023-01-18 21:41:22 -05:00
643d4fc6e3 Yes that check is needed
Thanks to @fosnola and whoever added that code in the Windows version
2023-01-18 21:37:07 -05:00
03342627ec Avoid integer overflow when positioning a dialog
Thanks to @fosnola for spotting
2023-01-18 21:35:29 -05:00
1bf079af5e Fix some missing initializers
Spotted by @fosnola
2023-01-18 21:16:33 -05:00
04d079fbaf Clean up cTown::set_up_lights
Thanks to @fosnola for spotting the potential buffer overreach
2023-01-18 21:14:19 -05:00
819b9ef48d Fix missing source file in VS2017 project 2023-01-18 21:09:07 -05:00
303b0b8114 Missed an initializer
Thanks to @fosnola for spotting this.
2023-01-18 20:58:13 -05:00
9536b79096 Reverse order of conditions to avoid integer overflow giving a fals positive
Thanks to @fosnola for spotting this.
2023-01-18 20:56:26 -05:00
a6196832de Fix item flags not being loaded correctly from saved games 2023-01-18 20:53:07 -05:00
63581d7b78 Hide shop scrollbar when not needed
This also fixes undefined or buggy behaviour in such a case.

Thanks to @fosnola for spotting this.
2023-01-18 20:47:16 -05:00
c7f4cee684 Also reset the time to 0, to indicate the timer is inactive 2023-01-18 20:32:53 -05:00
ALONSO Laurent
4eb9be21c6 try to avoid calling timers two times in a row... 2023-01-18 20:29:24 -05:00
dbdb7b8caf Show an error if a town or outdoor node is called in the wrong context 2023-01-18 20:29:17 -05:00
b422cdf429 Add some terrain bounds checking and some named constants 2023-01-18 20:08:56 -05:00
298e61e2f8 Fix buffer overreach in duplicate string detection
Thanks to @fosnola for the fix.
2023-01-18 14:20:36 -05:00
6b56f4af86 Add bounds-checking to coord_to_ter in the scenario editor 2023-01-18 10:00:08 -05:00
d0d7765d2d Fix monsters above 255 being unsummonable
Thanks to @fosnola for the fix.
2023-01-18 09:59:07 -05:00
3c246c7df5 Add some braces 2023-01-18 09:59:04 -05:00
924692c1dd Fix possible buffer overreach when selecting a shop item
Thanks to @fosnola for the fix.
2023-01-18 09:58:37 -05:00
20102c7f52 vector2d: few more tests 2023-01-18 09:53:19 -05:00
2492610ec7 Reading and writing saved games now uses the new tagfile system.
This should avoid any format inconsistencies, like missing newlines and the like.
Although a basic save and load works, there may still be some issues with the format.
This probably renders older saved games incompatible.
The format is mostly the same, but there are a few small changes
in the name of making the format more uniform.
2023-01-18 00:54:39 -05:00