View Issue Details

IDProjectCategoryView StatusLast Update
0005302The Dark ModCodingpublic18.07.2020 15:37
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.09 
Target VersionTDM 2.09Fixed in VersionTDM 2.09 
Summary0005302: House of Locked Secrets: crash because inventory cursor points to empty category
DescriptionThe inventory cursor system is pretty fragile, in a sense that it can easily leave pointing something empty.
It becomes especially bad when mapper starts removing inventory items in script.
Steps To Reproduce1) Start "A House Of Locked Secrets" FM.
2) Play normally until you find the lockpick in spirit realm.
3) Return back to physical realm using some "thing".
4) Choose the Holy Symbol in inventory.
5) Hit 'P' key (cycle through lockpicks) --- it would still leave Holy Symbol selected, but change cursor internally to lockpicks!
6) How apply Holy Symbol to the "thing" to get back to spirit realm.

At this moment cursor points to lockpicks category, which is empty.
The realm transitioning script calls getCurInvItemName, which crashes trying to get name of NULL item
Additional InformationOriginally reported here:
  https://forums.thedarkmod.com/index.php?/topic/17163-fan-mission-a-house-of-locked-secrets-by-gelo-moonbo-fleisher-20150528/&do=findComment&comment=449122
TagsNo tags attached.

Relationships

related to 0002993 resolvedSTiFU Removing an inventory item can invalidate cursor, resulting in crash 

Activities

stgatilov

stgatilov

18.07.2020 11:58

developer   ~0012659

Attached savegame from Bumbling Thief.
The savegame is from 2.08, but it works on trunk rev 8864.
To reproduce from it, just go forward and frob the holy symbol mini-statue on the desk.

To workaround the problem, hit the "Clean Inventory" key --- it is not bound to any key by default.
5302_crash.save (1,347,978 bytes)
stgatilov

stgatilov

18.07.2020 15:36

developer   ~0012660

It was most likely broken by 0002993, although perhaps it was broken before that too.

Basically, the whole inventory cursor system is so messy an fragile, that I don't care any more about it working correctly.
I simply reviewed the code and made sure everything that could be NULL is checked for NULL.
That's committed in svn rev 8866, and it fixes the crash.

The next problem is that instead of crash, now the Holy Symbol simply does not work.
Because the real "current item" is NULL --- it has become NULL when player hit 'P' to cycle through empty group of lockpicks.
But GUI still shows the Holy Symbol, giving very bad effect that active item does not work.
I with this in 8867: now cycling through empty group selects blank/dummy item.

Issue History

Date Modified Username Field Change
18.07.2020 11:50 stgatilov New Issue
18.07.2020 11:50 stgatilov Status new => assigned
18.07.2020 11:50 stgatilov Assigned To => stgatilov
18.07.2020 11:50 stgatilov Additional Information Updated View Revisions
18.07.2020 11:58 stgatilov Note Added: 0012659
18.07.2020 11:58 stgatilov File Added: 5302_crash.save
18.07.2020 15:33 stgatilov Relationship added related to 0002993
18.07.2020 15:36 stgatilov Note Added: 0012660
18.07.2020 15:37 stgatilov Status assigned => resolved
18.07.2020 15:37 stgatilov Resolution open => fixed
18.07.2020 15:37 stgatilov Fixed in Version => TDM 2.09