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

Some more code cleanup and refactoring #2842

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

schell244
Copy link
Contributor

🍰 Pullrequest

Code cleanup and some fixes based on Clang-Tidy suggestions.
Also resolved some compiler warnings.
No behavioural changes.

Proof

  • None

Issues

  • None

How2Test

  • None

Todo / Checklist

  • None

src/game/World.h Outdated
public:
SessionPacketSendTask(const SessionPacketSendTask&) = delete;
Copy link
Contributor

Choose a reason for hiding this comment

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

east const

@@ -491,7 +491,7 @@ void DungeonResetScheduler::ScheduleAllDungeonResets()
}
}

void DungeonResetScheduler::ScheduleReset(bool add, time_t time, DungeonResetEvent event)
void DungeonResetScheduler::ScheduleReset(bool add, time_t const time, DungeonResetEvent event)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not a pointer so no need for the time parameter to be const

@@ -300,7 +300,7 @@ class DungeonResetScheduler
m_resetTimeByMapId[mapId] = t;
}

void ScheduleReset(bool add, time_t time, DungeonResetEvent event);
void ScheduleReset(bool add, time_t const time, DungeonResetEvent event);
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for time to be const

@@ -215,7 +215,7 @@ Creature::Creature(CreatureSubtype subtype) :

Creature::~Creature()
{
CleanupsBeforeDelete();
Unit::CleanupsBeforeDelete();
Copy link
Contributor

Choose a reason for hiding this comment

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

why explicitly calling unit version

Copy link
Contributor Author

@schell244 schell244 Dec 7, 2024

Choose a reason for hiding this comment

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

Just for readability - there's no specific implementation for CleanupsBeforeDelete at creature (while at player there is, which then also calls Unit::CleanupsBeforeDelete).

@ratkosrb ratkosrb merged commit ae61d73 into vmangos:development Dec 20, 2024
3 checks passed
@schell244 schell244 deleted the code_cleanup_and_refactor branch December 20, 2024 09:01
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.

2 participants