Don't treat spikes as solid for non-humanoid entities

There's always been a bit of an inconsistency in the game where enabling
invincibility would make spikes so solid that enemies and moving
platforms would treat spikes as solid and bounces off of them.

This fixes that by adding an `invincible` parameter to collision
functions, so the functions will only treat spikes as solid if that
parameter is true, and the parameter passed will only be true if it's
called for an entity that is a humanoid and invincibility mode is
enabled.

Also, for clarity, `spikecollide` is renamed to `towerspikecollide`
because it's only used for tower spikes. And as a small optimization,
`checktowerspikes` returns early if invincibility mode is enabled.
This commit is contained in:
Misa
2022-06-05 20:17:26 -07:00
parent cc61194bed
commit f0aa1a8cae
4 changed files with 59 additions and 47 deletions

View File

@@ -129,8 +129,8 @@ public:
bool checktowerspikes(int t);
bool checkwall(const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipblocks, const bool skipdirblocks);
bool checkwall(const SDL_Rect& temprect);
bool checkwall(const bool invincible, const SDL_Rect& temprect, const float dx, const float dy, const float dr, const bool skipblocks, const bool skipdirblocks);
bool checkwall(const bool invincible, const SDL_Rect& temprect);
float hplatformat(const int px, const int py);