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

change scope of some player member functions #36802

Merged
merged 4 commits into from
Apr 3, 2020

Conversation

KorGgenT
Copy link
Member

@KorGgenT KorGgenT commented Jan 8, 2020

Summary

SUMMARY: Infrastructure "change scope of some player member functions"

Purpose of change

part of #34721
I changed the scope of the following player:: member functions to Character::

  • pos()
  • sight_range()
    note: changed return to use clamp instead of std::min(std::max())
  • unimpaired_range()
  • overmap_los()
  • overmap_sight_range()
  • clairvoyance()
  • sight_impaired()
  • has_alarm_clock()
  • has_watch()
  • action_taken()
  • is_on_ground()
  • swim_speed()

and the following function from player:: to Creature::

  • is_underwater()

Testing

Compiled, ran the game for a few turns. I expect this is actually a really safe change.

Additional context

No reason to rush it, even though i think it's safe some of my other PRs have made some bugs and we're closing in on 0.E

@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style 0.E Feature Freeze labels Jan 8, 2020
@lgtm-com
Copy link

lgtm-com bot commented Apr 3, 2020

This pull request introduces 1 alert and fixes 1 when merging cd90032 into db5ba71 - view on LGTM.com

new alerts:

  • 1 for Multiplication result converted to larger type

fixed alerts:

  • 1 for Multiplication result converted to larger type

@kevingranade kevingranade merged commit 84c739b into CleverRaven:master Apr 3, 2020

int player::sight_range( int light_level ) const
{
if( light_level == 0 ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You did not move that check, so it can cause DBZ now.

@KorGgenT KorGgenT deleted the deprecate-some-player branch August 13, 2020 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants