Skip to content

Commit

Permalink
improve: small adjustment to 'hasTraceableContext()' (#2374)
Browse files Browse the repository at this point in the history
- The 'checkCreatureWalk' function is of the 'Game' class and not 'Creature' as advertised.
- '__FUNCTION__' was only returning the name of the function and not the class, so it had been necessary to add it to 'hasTraceableContext()'.
  • Loading branch information
Luan Luciano authored Jun 22, 2024
1 parent e629491 commit fb20f6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void Creature::addEventWalk(bool firstStep) {

self->eventWalk = g_dispatcher().scheduleEvent(
static_cast<uint32_t>(ticks),
[creatureId = self->getID()] { g_game().checkCreatureWalk(creatureId); }, "Creature::checkCreatureWalk"
[creatureId = self->getID()] { g_game().checkCreatureWalk(creatureId); }, "Game::checkCreatureWalk"
);
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/game/scheduling/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class Task {

bool hasTraceableContext() const {
const static auto tasksContext = std::unordered_set<std::string_view>({
"Creature::checkCreatureWalk",
"Decay::checkDecay",
"Dispatcher::asyncEvent",
"Game::checkCreatureAttack",
"Game::checkCreatureWalk",
"Game::checkCreatures",
"Game::checkImbuements",
"Game::checkLight",
Expand All @@ -94,7 +94,6 @@ class Task {
"SpawnNpc::checkSpawnNpc",
"Webhook::run",
"Protocol::sendRecvMessageCallback",
"sendRecvMessageCallback",
});

return tasksContext.contains(context);
Expand Down
2 changes: 1 addition & 1 deletion src/server/network/protocol/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool Protocol::sendRecvMessageCallback(NetworkMessage &msg) {
protocol->parsePacket(msg);
protocolConnection->resumeWork();
}
} }, __FUNCTION__);
} }, "Protocol::sendRecvMessageCallback");

return true;
}
Expand Down

0 comments on commit fb20f6f

Please sign in to comment.