This commit is contained in:
aozhiwei 2019-04-22 13:45:48 +08:00
parent 4e3f00bc68
commit bdf403485b
2 changed files with 48 additions and 40 deletions

View File

@ -404,7 +404,8 @@ void Player::UpdateJump()
{
if (a8::HasBitFlag(status, HS_Fly)) {
DoJump();
room->xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 3,
for (size_t i = 0; i < 4; ++i){
room->xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE / 10,
a8::XParams()
.SetSender(this),
[] (const a8::XParams& param)
@ -415,7 +416,7 @@ void Player::UpdateJump()
.SetSender(hum),
[] (Human* hum, a8::XParams& param) -> bool
{
if (a8::HasBitFlag(hum->status, HS_Fly)) {
if (a8::HasBitFlag(hum->status, HS_Fly) && hum->entity_subtype != EST_Player) {
hum->DoJump();
return false;
}
@ -424,6 +425,7 @@ void Player::UpdateJump()
},
&xtimer_attacher.timer_list_);
}
}
jump = false;
}

View File

@ -368,6 +368,12 @@ void Room::CollisionDetection(Entity* sender, int detection_flags, std::vector<E
if (sender == pair.second) {
continue;
}
#if 1
if (std::abs(sender->pos.x - pair.second->pos.x) > 1000 ||
std::abs(sender->pos.y - pair.second->pos.y) > 1000){
continue;
}
#endif
if (a8::HasBitFlag(detection_flags, ET_Player) && pair.second->entity_type == ET_Player) {
if (sender->entity_type == ET_Bullet) {
Bullet* bullet = (Bullet*)sender;
@ -814,8 +820,8 @@ void Room::UpdateGas()
gas_data.gas_start_frameno = frame_no;
ShuaPlane();
RoomMgr::Instance()->RemoveFromInactiveRoomHash(room_uuid);
#if 1
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 3,
for (size_t i = 1; i < 7; ++i) {
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 3 * i,
a8::XParams()
.SetSender(this),
[] (const a8::XParams& param)
@ -826,7 +832,7 @@ void Room::UpdateGas()
.SetSender(room),
[] (Human* hum, a8::XParams& param) -> bool
{
if (a8::HasBitFlag(hum->status, HS_Fly)) {
if (a8::HasBitFlag(hum->status, HS_Fly) && hum->entity_subtype != EST_Player) {
hum->DoJump();
return false;
}
@ -834,7 +840,7 @@ void Room::UpdateGas()
});
},
&xtimer_attacher.timer_list_);
#endif
}
}
}
break;