mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-04 22:40:05 +00:00
Switched MobManager::step() to the timer.
It doesn't really need to run on every shard step. This makes it a lot less hot.
This commit is contained in:
parent
ba5998d53a
commit
95a79ec815
@ -87,6 +87,4 @@ void CNShardServer::onStep() {
|
||||
event.scheduledEvent = currTime + event.delta;
|
||||
}
|
||||
}
|
||||
|
||||
MobManager::step(currTime);
|
||||
}
|
||||
|
@ -9,6 +9,8 @@
|
||||
std::map<int32_t, Mob*> MobManager::Mobs;
|
||||
|
||||
void MobManager::init() {
|
||||
REGISTER_SHARD_TIMER(step, 200);
|
||||
|
||||
REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_ATTACK_NPCs, pcAttackNpcs);
|
||||
|
||||
REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_COMBAT_BEGIN, combatBegin);
|
||||
@ -207,7 +209,7 @@ void MobManager::roamingStep(Mob *mob, time_t currTime) {
|
||||
}
|
||||
}
|
||||
|
||||
void MobManager::step(time_t currTime) {
|
||||
void MobManager::step(CNServer *serv, time_t currTime) {
|
||||
for (auto& pair : Mobs) {
|
||||
int x = pair.second->appearanceData.iX;
|
||||
int y = pair.second->appearanceData.iY;
|
||||
|
@ -56,7 +56,7 @@ namespace MobManager {
|
||||
extern std::map<int32_t, Mob*> Mobs;
|
||||
|
||||
void init();
|
||||
void step(time_t);
|
||||
void step(CNServer*, time_t);
|
||||
|
||||
void deadStep(Mob*, time_t);
|
||||
void roamingStep(Mob*, time_t);
|
||||
|
Loading…
Reference in New Issue
Block a user