Skip to content

Commit

Permalink
update (core): Knock Back Helpers (#12639)
Browse files Browse the repository at this point in the history
Adds knock back helpers to the core for future core and module use.
  • Loading branch information
M'Dic committed Aug 6, 2022
1 parent 9c7a211 commit 825db0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
m_bHasDelayedTeleport = false;
teleportStore_options = 0;
m_canTeleport = false;
m_canKnockback = false;

m_trade = nullptr;

Expand Down
3 changes: 3 additions & 0 deletions src/server/game/Entities/Player/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,8 @@ class Player : public Unit, public GridObject<Player>

bool CanTeleport() { return m_canTeleport; }
void SetCanTeleport(bool value) { m_canTeleport = value; }
bool CanKnockback() { return m_canKnockback; }
void SetCanKnockback(bool value) { m_canKnockback = value; }

bool isAllowedToLoot(Creature const* creature);

Expand Down Expand Up @@ -2883,6 +2885,7 @@ class Player : public Unit, public GridObject<Player>
bool m_bMustDelayTeleport;
bool m_bHasDelayedTeleport;
bool m_canTeleport;
bool m_canKnockback;

std::unique_ptr<PetStable> m_petStable;

Expand Down
1 change: 1 addition & 0 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18727,6 +18727,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
player->SetCanFly(true, true);

sScriptMgr->AnticheatSetSkipOnePacketForASH(player, true);
player->SetCanKnockback(true);
}
}

Expand Down

0 comments on commit 825db0f

Please sign in to comment.