Skip to content

Commit

Permalink
Remove const Party_ptr&
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Sep 1, 2024
1 parent 6e8fe92 commit 0b8f40d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void Events::eventCreatureOnUpdateStorage(Creature* creature, uint32_t key, std:
}

// Party
bool Events::eventPartyOnJoin(const Party_ptr& party, Player* player)
bool Events::eventPartyOnJoin(Party_ptr party, Player* player)
{
// Party:onJoin(player) or Party.onJoin(self, player)
if (info.partyOnJoin == -1) {
Expand All @@ -407,7 +407,7 @@ bool Events::eventPartyOnJoin(const Party_ptr& party, Player* player)
return scriptInterface.callFunction(2);
}

bool Events::eventPartyOnLeave(const Party_ptr& party, Player* player)
bool Events::eventPartyOnLeave(Party_ptr party, Player* player)
{
// Party:onLeave(player) or Party.onLeave(self, player)
if (info.partyOnLeave == -1) {
Expand Down Expand Up @@ -458,7 +458,7 @@ bool Events::eventPartyOnDisband(Party_ptr party)
return scriptInterface.callFunction(1);
}

bool Events::eventPartyOnInvite(const Party_ptr& party, Player* player)
bool Events::eventPartyOnInvite(Party_ptr party, Player* player)
{
// Party:onInvite(player) or Party.onInvite(self, player)
if (info.partyOnInvite == -1) {
Expand All @@ -485,7 +485,7 @@ bool Events::eventPartyOnInvite(const Party_ptr& party, Player* player)
return scriptInterface.callFunction(2);
}

bool Events::eventPartyOnRevokeInvitation(const Party_ptr& party, Player* player)
bool Events::eventPartyOnRevokeInvitation(Party_ptr party, Player* player)
{
// Party:onRevokeInvitation(player) or Party.onRevokeInvitation(self, player)
if (info.partyOnRevokeInvitation == -1) {
Expand All @@ -512,7 +512,7 @@ bool Events::eventPartyOnRevokeInvitation(const Party_ptr& party, Player* player
return scriptInterface.callFunction(2);
}

bool Events::eventPartyOnPassLeadership(const Party_ptr& party, Player* player)
bool Events::eventPartyOnPassLeadership(Party_ptr party, Player* player)
{
// Party:onPassLeadership(player) or Party.onPassLeadership(self, player)
if (info.partyOnPassLeadership == -1) {
Expand All @@ -539,7 +539,7 @@ bool Events::eventPartyOnPassLeadership(const Party_ptr& party, Player* player)
return scriptInterface.callFunction(2);
}

void Events::eventPartyOnShareExperience(const Party_ptr& party, uint64_t& exp)
void Events::eventPartyOnShareExperience(Party_ptr party, uint64_t& exp)
{
// Party:onShareExperience(exp) or Party.onShareExperience(self, exp)
if (info.partyOnShareExperience == -1) {
Expand Down
12 changes: 6 additions & 6 deletions src/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ class Events
std::optional<int32_t> oldValue, bool isSpawn);

// Party
bool eventPartyOnJoin(const Party_ptr& party, Player* player);
bool eventPartyOnLeave(const Party_ptr& party, Player* player);
bool eventPartyOnJoin(Party_ptr party, Player* player);
bool eventPartyOnLeave(Party_ptr party, Player* player);
bool eventPartyOnDisband(Party_ptr party);
void eventPartyOnShareExperience(const Party_ptr& party, uint64_t& exp);
bool eventPartyOnInvite(const Party_ptr& party, Player* player);
bool eventPartyOnRevokeInvitation(const Party_ptr& party, Player* player);
bool eventPartyOnPassLeadership(const Party_ptr& party, Player* player);
void eventPartyOnShareExperience(Party_ptr party, uint64_t& exp);
bool eventPartyOnInvite(Party_ptr party, Player* player);
bool eventPartyOnRevokeInvitation(Party_ptr party, Player* player);
bool eventPartyOnPassLeadership(Party_ptr party, Player* player);

// Player
bool eventPlayerOnBrowseField(Player* player, const Position& position);
Expand Down
4 changes: 2 additions & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4230,7 +4230,7 @@ void Player::sendPlayerPartyIcons(Player* player)
sendCreatureSkull(player);
}

bool Player::addPartyInvitation(const Party_ptr& party)
bool Player::addPartyInvitation(Party_ptr party)
{
auto it = std::find(invitePartyList.begin(), invitePartyList.end(), party);
if (it != invitePartyList.end()) {
Expand All @@ -4241,7 +4241,7 @@ bool Player::addPartyInvitation(const Party_ptr& party)
return true;
}

void Player::removePartyInvitation(const Party_ptr& party) { invitePartyList.remove(party); }
void Player::removePartyInvitation(Party_ptr party) { invitePartyList.remove(party); }

void Player::clearPartyInvitations()
{
Expand Down
4 changes: 2 additions & 2 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class Player final : public Creature, public Cylinder
bool isInviting(const Player* player) const;
bool isPartner(const Player* player) const;
void sendPlayerPartyIcons(Player* player);
bool addPartyInvitation(const Party_ptr& party);
void removePartyInvitation(const Party_ptr& party);
bool addPartyInvitation(Party_ptr party);
void removePartyInvitation(Party_ptr party);
void clearPartyInvitations();

GuildEmblems_t getGuildEmblem(const Player* player) const;
Expand Down

0 comments on commit 0b8f40d

Please sign in to comment.