Skip to content

Commit

Permalink
fix: questlog message (#1648)
Browse files Browse the repository at this point in the history
  • Loading branch information
un000000 authored Sep 29, 2023
1 parent 9754741 commit 68bbe7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,13 @@ void Player::addStorageValue(const uint32_t key, const int32_t value, const bool
}

if (value != -1) {
int32_t oldValue = getStorageValue(key);
storageMap[key] = value;

if (!isLogin) {
auto currentFrameTime = g_dispatcher().getDispatcherCycle();
g_events().eventOnStorageUpdate(static_self_cast<Player>(), key, value, getStorageValue(key), currentFrameTime);
g_callbacks().executeCallback(EventCallback_t::playerOnStorageUpdate, &EventCallback::playerOnStorageUpdate, getPlayer(), key, value, getStorageValue(key), currentFrameTime);
g_events().eventOnStorageUpdate(static_self_cast<Player>(), key, value, oldValue, currentFrameTime);
g_callbacks().executeCallback(EventCallback_t::playerOnStorageUpdate, &EventCallback::playerOnStorageUpdate, getPlayer(), key, value, oldValue, currentFrameTime);
}
} else {
storageMap.erase(key);
Expand Down

0 comments on commit 68bbe7c

Please sign in to comment.