harbingerofme / DebugToolkit

Debugging commands for Risk of Rain 2. Previously known as RoR2Cheats.
https://thunderstore.io/package/IHarbHD/DebugToolkit/
BSD 3-Clause "New" or "Revised" License
14 stars 8 forks source link

Fix noclip issues #161

Closed SChinchi closed 7 months ago

SChinchi commented 8 months ago

Fixes #160

The command did not null check for components it needed access to. As such it would throw for flyers. The checks themselves wouldn't make it functional for flyers, which require turning off collisions from the entity's collider directly and modifying the rigid body's velocity in a similar manner to the character motor.

Incidentally, by checking for collidableLayers != 0 fixes another bug where the imp overlord and merc would have their layers rebuilt after blinking/dashing. For that reason it's also cleaner to not cache the layers but allow the game to rebuild them, since the entity states related to the aforementioned skills change the character's layer for both entering and exiting the state.

The gravity bug blindly turned gravity off when noclip was disabled instead of checking whether gravity should be on/off based on environmental context.