This commit is contained in:
aozhiwei 2019-03-20 15:25:59 +08:00
parent 3ad1dda451
commit f3ba4ae130
3 changed files with 5 additions and 3 deletions

View File

@ -146,18 +146,18 @@ int App::Run()
int ret = 0;
a8::UdpLog::Instance()->Info("gameserver running", {});
last_run_tick_ = a8::XGetTickCount();
int delta_time = 0;
while (!terminated) {
a8::tick_t begin_tick = a8::XGetTickCount();
Global::g_nowtime = time(nullptr);
int delta_time = a8::XGetTickCount() - last_run_tick_;
QuickExecute(delta_time);
SlowerExecute(delta_time);
Schedule();
a8::tick_t end_tick = a8::XGetTickCount();
if (end_tick - begin_tick > perf.max_run_delay_time) {
perf.max_run_delay_time = end_tick - begin_tick;
}
Schedule();
last_run_tick_ = a8::XGetTickCount();
delta_time = end_tick - begin_tick;
}
return ret;
}

View File

@ -10,6 +10,7 @@ Bullet::Bullet():Entity()
{
entity_type = ET_Bullet;
movement = new MovementComponent();
movement->owner = this;
}
Bullet::~Bullet()

View File

@ -11,6 +11,7 @@
Human::Human()
{
movement = new MovementComponent();
movement->owner = this;
}
Human::~Human()