fix(Core/Player): Weapon skill gain (#5961)

This commit is contained in:
Kitzunu
2021-05-28 00:49:24 +02:00
committed by GitHub
parent d8911d816f
commit f1b43a8976
5 changed files with 35 additions and 12 deletions

View File

@@ -266,6 +266,7 @@ public:
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
[[nodiscard]] inline bool IsPlayer() const { return GetTypeId() == TYPEID_PLAYER; }
Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return nullptr; }
[[nodiscard]] Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return nullptr; }
Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return nullptr; }