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

Fix for Thirst related Alive/Death handling #5

Merged
merged 4 commits into from Aug 1, 2017

Conversation

nihal111
Copy link
Member

@nihal111 nihal111 commented Jul 31, 2017

@nihal111 nihal111 changed the title Fix for Alive/Death handling Fix for Thirst related Alive/Death handling Jul 31, 2017
@xrtariq2594
Copy link
Member

It looks good to me!

Thanks for the corrections and formatting changes as well.

@Cervator Cervator merged commit ddb65bd into Terasology:master Aug 1, 2017
Copy link
Contributor

@skaldarnar skaldarnar left a comment

Choose a reason for hiding this comment

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

With the recent work on exposing more internal logic via events in DynamicCities, the question above below came to my mind....
What do you think about this?

thirst.lastCalculatedWater = ThirstUtils.getThirstForEntity(entity);
public void onPlayerRespawn(OnPlayerRespawnedEvent event, EntityRef player,
ThirstComponent thirst) {
logger.info("mark");
Copy link
Contributor

Choose a reason for hiding this comment

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

stray logging statement feels lonely 😢

resetThirst(player, thirst);
}

private void resetThirst(EntityRef player, ThirstComponent thirst) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to expose the resetThirst functionality as event + handler? That way, another module could modify the behavior in case a player respawns after death. For instance, start only with half the thirst meter in general, and only respawn with full thirst meter if you have some item equipped.

Copy link
Member

Choose a reason for hiding this comment

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

Seems sensible, although it may get lost on this closed PR. Maybe better to submit as an enhancement request issue :-)

Copy link
Member

Choose a reason for hiding this comment

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

That'd seem interesting @skaldarnar @Cervator. I'd suggest submitting an issue with this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants