diff --git a/server/gameserver/frameevent.cc b/server/gameserver/frameevent.cc index c898e66..c41141b 100644 --- a/server/gameserver/frameevent.cc +++ b/server/gameserver/frameevent.cc @@ -57,7 +57,7 @@ void FrameEvent::AddShot(Human* hum) } } -void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance) +void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance, int hit_time) { { auto& tuple = a8::FastAppend(bullets_); @@ -74,6 +74,9 @@ void FrameEvent::AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fl p.set_gun_id(hum->curr_weapon->meta->i->id()); p.set_gun_lv(hum->curr_weapon->weapon_lv); p.set_fly_distance(fly_distance); + if (hit_time != 0) { + p.set_hit_time(hit_time); + } } { int bullet_idx = bullets_.size() - 1; diff --git a/server/gameserver/frameevent.h b/server/gameserver/frameevent.h index b1ef3d0..c995863 100644 --- a/server/gameserver/frameevent.h +++ b/server/gameserver/frameevent.h @@ -15,7 +15,7 @@ public: void AddAirDrop(int appear_time, int box_id, a8::Vec2 box_pos); void AddEmote(Human* hum, int emote_id); void AddShot(Human* hum); - void AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance); + void AddBullet(Human* hum, a8::Vec2 born_pos, a8::Vec2 dir, float fly_distance, int hit_time); void AddExplosion(int item_id, a8::Vec2 bomb_pos, int effect); void AddSmoke(Bullet* bullet, int item_id, a8::Vec2 pos); void AddDead(Human* hum); diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 87fa9d0..2af9d28 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -236,7 +236,8 @@ void Human::DirectShot(MetaData::Equip* bullet_meta) } } bullet_dir.Rotate(bullet_angle / 180.0f); - room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance); + int hit_time = 0; + room->frame_event.AddBullet(this, bullet_born_pos, attack_dir, fly_distance, hit_time); if (room->BattleStarted()) { room->CreateBullet(this, bullet_meta, bullet_born_pos, bullet_dir, fly_distance); }