Commit Graph

2069 Commits

Author SHA1 Message Date
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
99bd1678e4 tagfile: Support mapped containers, similar to a sparse array
Note: This now treats vector<pair> as a mapped container as well – an ordered multimap, so to speak
2023-01-18 00:54:39 -05:00
50d611e319 tagfile: Support vector2d, both sparse and dense 2023-01-18 00:54:39 -05:00
9aa0262247 vector2d: row/col assignment (+test), default value in resize 2023-01-18 00:54:39 -05:00
50bd1e9c6e tagfile: A few more tests; support sparse arrays 2023-01-18 00:54:39 -05:00
d3ed054bbb tagfile: Support hexadecimal integer tags 2023-01-18 00:54:39 -05:00
e5b347c70f tagfile: A few more tests; fix tuple handling 2023-01-18 00:54:39 -05:00
40db245011 maybe_quote_string now quotes the empty string 2023-01-18 00:54:39 -05:00
657df9ea8d Rework the tagfile library
After further experimentation, the previous template-heavy design
turned out to cause issues with compilation.

Thus, it has now been replaced with a simpler, dumber implementation
that pushes more of the logic into the caller.
2023-01-18 00:54:39 -05:00
1ee72df836 Add the new files to the Xcode 4 project 2023-01-18 00:54:39 -05:00
492e4b0cf9 Add 10 scenario timers to editor in a stack 2023-01-14 01:26:49 -05:00
91140aa6d4 cDialog handle text fields in containers 2023-01-14 01:26:49 -05:00
1996985b50 include cstddef to compile on linux (#310) 2023-01-14 01:17:18 -05:00
6729983892 Fix glowing crystal soul artifacts and add a leather helm graphic
Contributed by @clort81 and closes #262

[ci skip]
2023-01-14 00:11:58 -05:00
248ac94bf9 Fix arrow keys
Still part of #291
2023-01-13 19:59:30 -05:00
e0418c685a Track modifier state in the main loops
Really fixes #291
2023-01-13 19:55:24 -05:00
6e238881ae Fix a vector2d::resize overflow bug
Found by running asan
Should fix the CI failure...?
2023-01-13 19:37:16 -05:00
7055d5eba4 Don't crash when canceling scenario import pick (#308) 2023-01-13 19:23:28 -05:00
2d6a5cae5e Use events instead of isKeyPressed for the interrupt key
Also related to #291
2023-01-12 21:52:02 -05:00
3bdcf02be0 Handle modifier keys differently to avoid Apple flagging us as wishing to monitor input from other applications
Fixes #291
2023-01-12 21:43:45 -05:00
35a890a577 Add a partial unit test for vector2d and fix several issues with the resize function 2023-01-12 21:26:08 -05:00
8872f1aa25 Stop storing players as bare pointers - use unique_ptr instead
Should fix some potential memory leaks that were caught by static analysis
2023-01-12 21:26:08 -05:00
1a82f8ff8b Fix a memory leak found by static analysis 2023-01-12 20:24:39 -05:00
e212e99794 Fix buffer overrun if apply/removeShift is called with an unknown character 2023-01-12 20:24:35 -05:00