Skip to content

Fix inventory cloning bug#338

Merged
Asdow merged 1 commit into
masterfrom
inventory-clone-fix
Nov 16, 2024
Merged

Fix inventory cloning bug#338
Asdow merged 1 commit into
masterfrom
inventory-clone-fix

Conversation

@Asdow
Copy link
Copy Markdown
Contributor

@Asdow Asdow commented Nov 16, 2024

  • If we have a sector already loaded (eg. Drassen airport)
  • Squad in a different sector encounters enemies and goes to autoresolve
  • After pressing DONE in autoresolve screen -> we miss calling the TrashWorld() function in CheckAndHandleUnloadingOfCurrentWorld() due to battle sector not being the same as loaded sector.
  • Selected sector gets reset from Drassen airport to invalid values by same function
  • Now we have the loaded sector's whole inventory existing in gWorldItems
  • Enter any sector in tactical mode and the gWorldItems gets added into its sector inventory in EnterSector()

Because the TrashItems() work in a way where it only sets gWorldItems elements to not existing if it finds them in a loaded map's structure data, we will pretty much always have that original bugged out set of items present in gWorlItems and they will constantly be added to sector inventories from then on once the bug has been triggered.

- If we have a sector already loaded (eg. Drassen airport)
- Squad in a different sector encounters enemies and goes to autoresolve
- After pressing DONE in autoresolve screen -> we miss calling the TrashWorld() function in CheckAndHandleUnloadingOfCurrentWorld() due to battle sector not being the same as loaded sector.
- Selected sector gets reset from Drassen airport to invalid values by same function
- Now we have the loaded sector's whole inventory existing in gWorldItems
 - Enter any other sector in tactical mode and the gWorldItems gets added into its sector inventory in EnterSector()

Because the TrashItems() work in a way where it only sets gWorldItems elements to not existing if it finds them in a loaded map's structure data, we will pretty much always have that original bugged out set of items present in gWorlItems and they will constantly be added to sector inventories from then on once the bug has been triggered.
@Asdow Asdow merged commit 1cd94cd into master Nov 16, 2024
@Asdow Asdow deleted the inventory-clone-fix branch November 19, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant