Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
717 stars 81 forks source link

Carryable Object Destruction Results in Error #108

Closed ac-arcana closed 4 months ago

ac-arcana commented 4 months ago

If you are carrying a carryable and it is destroyed while you are carrying it, then when you next press the carry input there is an error.

Phazorknight commented 4 months ago

Thanks for flagging this. Have a pretty good idea on what causes this and how to fix it, so should be able to get this done today.

Phazorknight commented 4 months ago

Please check https://github.com/Phazorknight/Cogito/commit/003d035fe75bc7a915e7a6d13353f3850b646a39.

This adds a check to the Player Interaction component to see if the carryable object reference is still valid, and if not clears it. You should no longer get crashes, but it's possible that you have to press an interact button first before the reference is updated. Will see if I can somehow make it cleaner, but if it works for you, I'd consider this resolved.

ac-arcana commented 4 months ago

Solved!