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

Move map cache to monster #4788

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ramon-bernardo
Copy link
Contributor

@ramon-bernardo ramon-bernardo commented Sep 19, 2024

Pull Request Prelude

See above.

Copy link
Contributor Author

@ramon-bernardo ramon-bernardo left a comment

Choose a reason for hiding this comment

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

I'm not sure if it was clear, but the map cache is used only for monsters due to the overriding of this method. We can move it to the monster class in that case.

@@ -218,7 +231,17 @@ class Monster final : public Creature
uint32_t getDamageImmunities() const override { return mType->info.damageImmunities; }
uint32_t getConditionImmunities() const override { return mType->info.conditionImmunities; }
void getPathSearchParams(const Creature* creature, FindPathParams& fpp) const override;
bool useCacheMap() const override { return !randomStepping; }
Copy link
Contributor Author

@ramon-bernardo ramon-bernardo Sep 25, 2024

Choose a reason for hiding this comment

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

Override here. (monster)

@@ -355,19 +354,12 @@ class Creature : virtual public Thing
decltype(auto) getStorageMap() const { return storageMap; }

protected:
virtual bool useCacheMap() const { return false; }
Copy link
Contributor Author

@ramon-bernardo ramon-bernardo Sep 25, 2024

Choose a reason for hiding this comment

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

Virtual creature function.

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.

1 participant