2375 Commits

Author SHA1 Message Date
PushmePullyu
ba601d9520 NUVIE: Fix event handling in cut-scenes
Input polling function: Stay in the event loop instead of returning on
events we do not want to handle. Always push a return value on the lua
stack unless the event queue is actually empty.
2023-03-13 20:19:13 -07:00
PushmePullyu
33d1a4f8b0 NUVIE: Fix Ultima 6 item order in containers when saving
Traverse container content list from the start instead of the end
when saving chunks so the items are stored in the correct order.
2023-03-13 20:12:08 -07:00
PushmePullyu
461ca0cbbf NUVIE: Fix Ultima 6 item order when player searches containers
Traverse container content list from the start instead of the end
so items get moved to the map in the correct order.

Fixes #13514
2023-03-13 20:12:08 -07:00
PushmePullyu
9365613ee4 NUVIE: Fix Ultima 6 item order in containers
Add items to containers in the correct order when loading a chunk.
2023-03-13 20:12:08 -07:00
PushmePullyu
05ae18340d NUVIE: Fix Ultima 6 crash on loading save
Fix a use-after-free bug. The chain of events causing it is as follows:

In-game the user changes the current view (e.g. by pressing TAB to
go to inventory view). The user next presses ESC to open the
GameMenuDialog and then clicks the "Load Game" button. A save slot is
selected and then loaded.

The resulting call chain is:

GUI_Button::Activate_button()
  GameMenuDialog::callback()
    GameMenuDialog::close_dialog() <-- This marks GameMenuDialog
                                       for deletion by the GUI
    g_engine->loadGameDialog()
      GUI::AddWidget() <-------------- This deletes GameMenuDialog
                                       and its children, including
                                       the "Load Game" button

Control then returns to GUI_Button::Activate_button() with "this"
containing the address of the freed button.

An attempt to call Redraw() finally dereferences the invalid pointer.

This is fixed by calling loadGameDialog() before close_dialog().
2023-03-13 20:08:07 -07:00
Matthew Jimenez
c1089937c3 ULTIMA8: Stop gravity process from putting items in a negative Z coordinate
This better follows original behavior and fixes accidental deletion of main actor. Fixes #14053
2023-02-18 23:36:10 -06:00
Matthew Jimenez
66dbbfb59a ULTIMA8: Adjust mouse length & direction offset to be fixed instead of scaled with height. 2023-02-16 22:18:50 -06:00
Matthew Jimenez
d5b7ac031d ULTIMA8: Fix sort item shape screenspace calculation for flipped items. 2023-02-14 18:25:45 -06:00
Matthew Jimenez
1c159c0c59 ULTIMA8: Change sort item constructor to not include next pointer 2023-02-14 18:25:45 -06:00
Matthew Jimenez
5e78e16da6 ULTIMA8: Fix overlap comparison of items during paint debugging 2023-02-14 18:25:45 -06:00
D G Turner
d65758cfea ULTIMA: NUVIE: Fix Format Truncation GCC Compiler Warnings 2023-02-14 21:42:42 +00:00
D G Turner
6ec5d970f6 ULTIMA: ULTIMA4: Fix Format Truncation GCC Compiler Warnings 2023-02-13 17:35:17 +00:00
Matthew Jimenez
a178a6771e ULTIMA8: Fix #14031 - ignore transparent non-solids when tracing items. 2023-02-10 17:31:47 -06:00
Matthew Jimenez
c32b0f88da ULTIMA8: Fix rendering for transparent item drawn after only if locations are equal 2023-02-07 18:11:38 -06:00
Cameron Cawley
4c3424bf55 ULTIMA: ULTIMA4: Simplify palette code 2023-02-08 00:09:39 +01:00
Cameron Cawley
01e0459f05 ULTIMA: NUVIE: Simplify palette code 2023-02-08 00:09:39 +01:00
Matthew Jimenez
bbc3266299 ULTIMA8: Remove pent_include.h 2023-02-04 11:11:31 -06:00
Matthew Jimenez
7ea747ff40 ULTIMA8: Remove istring.h from pent_include.h 2023-02-04 11:11:31 -06:00
Matthew Jimenez
c30df70a12 ULTIMA8: Remove debugger.h from pent_include.h 2023-02-04 11:11:31 -06:00
Matthew Jimenez
46118c2100 ULTIMA8: Cleanup shutdown methods 2023-02-02 18:23:33 -06:00
Matthew Jimenez
f0bd3fb39f ULTIMA8: Replace FORGET_OBJECT macro with delete and nullptr assignment where needed 2023-02-02 18:23:33 -06:00
Matthew Jimenez
992c25793e ULTIMA8: Replace CANT_HAPPEN macro usage with warning or error 2023-02-02 18:23:32 -06:00
Matthew Jimenez
4ff10c5256 ULTIMA8: Add test case for inventory item sort rule 2023-01-28 18:06:07 -06:00
Matthew Jimenez
37afcbc2aa ULTIMA8: Move inventory sort item rule down and make consistent. 2023-01-28 14:13:21 -06:00
Matthew Jimenez
65b725c12a ULTIMA8: Add sprite rule to sort item listLessThan to fix rendering bug 2023-01-28 08:08:13 -06:00
Matthew Jimenez
3cafae9398 ULTIMA8: Fix sort item hidden easter egg item and test 2023-01-27 17:55:23 -06:00
Matthew Jimenez
8191740ec8 ULTIMA8: Fix signed value loading of shape frame format. Bug #14066 2023-01-26 20:33:14 -06:00
Matthew Jimenez
f1d6ad795a ULTIMA8: Use shape frame screen rect in sort item occludes and overlaps checks in addition to world box. Fixes #14039 2023-01-26 18:53:01 -06:00
Matthew Jimenez
62b4aec959 ULTIMA8: Use box struct to set bounds of sort items 2023-01-26 18:53:01 -06:00
Matthew Jimenez
71bf75783d ULTIMA8: Replace sort item screenspace coords with rect 2023-01-26 18:53:01 -06:00
Matthew Jimenez
6e3a288d93 ULTIMA8: Add contains point method for sort items 2023-01-26 18:53:01 -06:00
Matthew Jimenez
eb5a079fd3 ULTIMA8: Fix item sorter dependency graph cycle and add test 2023-01-24 22:59:25 -06:00
Matthew Jimenez
e813af901f ULTIMA8: Remove x & y flat checks that introduced bugs 2023-01-24 21:18:23 -06:00
Matthew Jimenez
b616f53a89 ULTIMA8: Improve item sorter debugging. 2023-01-24 21:18:23 -06:00
Matthew Jimenez
644556324a ULTIMA8: Cleanup item sort dependency insertion 2023-01-22 22:23:07 -06:00
Matthew Jimenez
9fd47f8aba ULTIMA8: Small cleanup for sort item preliminary list sort. 2023-01-22 22:23:07 -06:00
Matthew Jimenez
9877dd915a ULTIMA8: Simplify item sort to have have fewer paths for flat vs non-flat items.
This also has more consistency for flat x & y coordinates. This does not address any specific rendering issue and counld introduce new issues, so it is not currently recommended for previous branches.
2023-01-22 22:23:07 -06:00
Eugene Sandulenko
d988cd7398
ULTIMA: Rename meta_engine.* -> metaengine.* for consistency 2023-01-22 22:57:29 +01:00
Matthew Jimenez
edd82bb8e8 ULTIMA8: Additional item sort rules and test.
This also fixes #14035
2023-01-22 11:42:04 -06:00
Matthew Duggan
b43bc49afb ULTIMA: NUVIE: Fix potential use of uninitialized variable 2023-01-21 16:01:17 +09:00
Matthew Jimenez
a48539379a ULTIMA8: Check "lastSave" setting exists before using as save slot.
This was forcing slot zero when even if no saves exist, causing an error on load
2023-01-20 23:25:55 -06:00
Matthew Jimenez
2e11704ed9 ULTIMA8: Update box struct better match rect methods 2023-01-18 21:54:41 -06:00
Matthew Jimenez
00583aa7f5 ULTIMA8: Add basic test for sort item occludes 2023-01-17 23:19:09 -06:00
Matthew Jimenez
70d6df35d8 ULTIMA8: Remove check to change save slot for invalid save files.
This masked errors that should occur on loading missing or invalid save files.
2023-01-15 15:09:59 -06:00
Matthew Duggan
cc34d4ee63 ULTIMA8: Remove outdated comment 2023-01-15 22:28:38 +09:00
Matthew Duggan
4cfa4c9c0c ULTIMA8: Fix SuperSprite itemsize calculation 2023-01-15 22:28:24 +09:00
Matthew Duggan
9831b91c1d ULTIMA8: Fix possible random number overflow
The uint result was cast to int, sometimes giving negative values.
2023-01-14 15:41:50 +09:00
Matthew Jimenez
5d13b0831b ULTIMA8: Add item sort rules for land and roof.
This fixes Pentagram bug #276.
2023-01-13 18:57:58 -06:00
Matthew Jimenez
44fdee6494 ULTIMA8: Move highlight items key binds to the debug category 2023-01-10 17:55:16 -06:00
Matthew Jimenez
1b05f7ec62 ULTIMA8: Fix check for item animation on type 4 2023-01-09 17:27:52 -06:00