Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_liquids_at function and small stuff #392

Merged
merged 6 commits into from
Dec 29, 2024

Conversation

SereneRuby12
Copy link
Contributor

I added the ENTITY_MASK enum, I didn't if name it MASK because sounds too much of a generic name, but if someone thinks it's fine then I'll change it

src/game_api/aliases.hpp Outdated Show resolved Hide resolved
@Mr-Auto
Copy link
Contributor

Mr-Auto commented Aug 4, 2024

Btw. I'm still trying to figure out why would anyone want to know number of liquid entity/particles in a tile?
what's the use?

@SereneRuby12
Copy link
Contributor Author

The array is how the game mostly checks for liquid collisions (eg. Entity:is_in_liquid() uses it), it makes sense to also use it for mods, and not be checking for if every blob of liquid is colliding a hitbox

@SereneRuby12
Copy link
Contributor Author

This is be ready for review/merge now

src/game_api/rpc.cpp Outdated Show resolved Hide resolved
@Mr-Auto
Copy link
Contributor

Mr-Auto commented Dec 26, 2024

Hmmm now that i think about this, instead of using ENTITY_MASK for this, which contains much more then just the two liquids, you could just return tuple with both, water and lava. And whoever uses this can decide to use one or both in whatever way they want to

@SereneRuby12
Copy link
Contributor Author

Hmmm now that i think about this, instead of using ENTITY_MASK for this, which contains much more then just the two liquids, you could just return tuple with both, water and lava. And whoever uses this can decide to use one or both in whatever way they want to

It would have been better months ago when I asked about it... but well that makes sense

Copy link
Contributor

@Mr-Auto Mr-Auto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good
last note: in get_liquids_at you didn't specify the literal values as floats, so the math is done with doubles

Not a big deal, probably done many times all over the API anyway

@SereneRuby12
Copy link
Contributor Author

last note: in get_liquids_at you didn't specify the literal values as floats, so the math is done with doubles

oh, you're right... I'm pretty perfectionist so I'll fix that anyway, it's just adding an f at the end of the literals 🐈

@SereneRuby12 SereneRuby12 merged commit 6403a39 into spelunky-fyi:main Dec 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants