Skip to content

Commit

Permalink
refactor: using virtual function check actor type
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Feb 17, 2024
1 parent c05c2e7 commit d38c5cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/ll/api/event/player/PlayerPlaceBlockEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LL_TYPE_INSTANCE_HOOK(
ItemStackBase const& item,
bool genParticle
) {
if (actor.hasCategory(ActorCategory::Player)) {
if (actor.isPlayer()) {
auto event = PlayerPlacingBlockEvent{static_cast<Player&>(actor), blockpos, face};
EventBus::getInstance().publish(event);
if (event.isCancelled()) {
Expand Down
2 changes: 0 additions & 2 deletions src/mc/deps/core/string/HashedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ class HashedString {
}

// Convertors
[[nodiscard]] constexpr operator std::string&() { return str; } // NOLINT

[[nodiscard]] constexpr operator std::string const&() const { return str; } // NOLINT

[[nodiscard]] constexpr operator std::string_view() const { return std::string_view(str); } // NOLINT
Expand Down

0 comments on commit d38c5cf

Please sign in to comment.