Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
12 stars 5 forks source link

Player can grab items trough walls #357

Closed snipercup closed 4 weeks ago

snipercup commented 1 month ago

The player can grab items from a container using the inventory window, even if there is a wall/window in the way

Steps to reproduce:

This but returned after implementing FurnitureStaticSrv and I didn't put the check for walls back.

These lines add the container to the inventory window: https://github.com/snipercup/CataX/blob/5600167cf58a17b8c7281d51455afa0dcde53f19/Scripts/FurnitureStaticSpawner.gd#L126-L143

We need to use this function in the ItemDetector to prevent access to a container behind a collider: https://github.com/snipercup/CataX/blob/5600167cf58a17b8c7281d51455afa0dcde53f19/Scripts/ItemDetector.gd#L45-L74

We will need to make adjustments to the function above and implement it in: https://github.com/snipercup/CataX/blob/5600167cf58a17b8c7281d51455afa0dcde53f19/Scripts/ItemDetector.gd#L77-L79