Introduces new functions to check for presence of and remove player items.
These functions do not rely on or expose item indices.
They're implemented as free functions instead of Player methods due to
complicated include dependencies between `player.h`, `inv.h`, and
`inv_iterators.h`. We should probably look into cleaning this up at some
point.
I don't think this ever comes up because no spells have an sManaCost of 255, however _pMaxManaBase is stored as fixed point, so it should be shifted before use.
But to be honest, I'm not even sure what it is trying to do here. Was sManaCost == 255 supposed to indicate that it was going to use all the player's mana? Why was it cast to a BYTE before using it? Did they intend to limit the manage usage to 255 and just screwed up? I originally saw this logic in Devilution, and found it because the Middle Earth mod had a slight change here, where it used pMana (maybe because they thought it was intended to be a spell that used all the player's mana?) Also, I saw that in 1.07, Ghidra saw `ma` as a byte, not an int as written in Devilution - I wonder if that's where the cast came from? In the ME Mod version, it sees `ma` as an int.
Identified and removed an instance of Direction being used as an argument for a bool parameter
Removed a single-use temporary variable being cast from sprite frame to direction to size_t
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Fix alignment of WalkSettings array
Use Point wherever possible
Make some functions static (not exhaustive)
Reduce excessive indentation (not exhaustive)
Declare variables as needed (not exhaustive)