This commit is contained in:
aozhiwei 2023-05-19 13:37:06 +08:00
parent b79c4c972a
commit 9912e197b7
4 changed files with 23 additions and 9 deletions

View File

@ -2301,16 +2301,20 @@ void Creature::UpdateMove()
if (GetMovement()->UpdatePosition()) { if (GetMovement()->UpdatePosition()) {
} else { } else {
if (!GetMovement()->IsFindPath()) { if (!GetMovement()->IsFindPath()) {
GetMovement()->CalcTargetPos(mt::Param::s().move_step_len); if (room->GetGasData().GetGasMode() == GasInactive &&
if (!GetMovement()->UpdatePosition()) { room->IsSandTableRoom()) {
if (IsPlayer()) { } else {
if (HasBuffEffect(kBET_Sprint)) { GetMovement()->CalcTargetPos(mt::Param::s().move_step_len);
SprintBuff* buff = (SprintBuff*)GetBuffByEffectId(kBET_Sprint); if (!GetMovement()->UpdatePosition()) {
if (buff) { if (IsPlayer()) {
buff->SprintEnd(); if (HasBuffEffect(kBET_Sprint)) {
SprintBuff* buff = (SprintBuff*)GetBuffByEffectId(kBET_Sprint);
if (buff) {
buff->SprintEnd();
}
} else {
ShortFindPath();
} }
} else {
ShortFindPath();
} }
} }
} }
@ -2961,6 +2965,10 @@ float Creature::GetSpeed()
} }
*/ */
if (room->GetGasData().GetGasMode() == GasInactive &&
room->IsSandTableRoom()) {
return mt::Param::s().sand_table_move_speed / SERVER_FRAME_RATE;
}
if (HasBuffEffect(kBET_Jump)) { if (HasBuffEffect(kBET_Jump)) {
finaly_speed = GetHeroMeta()->jump_speed(); finaly_speed = GetHeroMeta()->jump_speed();
} else if (HasBuffEffect(kBET_Down)) { } else if (HasBuffEffect(kBET_Down)) {

View File

@ -37,6 +37,7 @@ namespace mt
s_.match_choose_time = GetIntParam("match_choose_time", 0); s_.match_choose_time = GetIntParam("match_choose_time", 0);
s_.match_lock_time = GetIntParam("match_lock_time", 0); s_.match_lock_time = GetIntParam("match_lock_time", 0);
s_.pickup_weapon_replace_type = GetIntParam("pickup_weapon_replace_type", 0); s_.pickup_weapon_replace_type = GetIntParam("pickup_weapon_replace_type", 0);
s_.sand_table_move_speed = GetIntParam("sand_table_move_speed", 500);
#if 1 #if 1
s_.match_lock_time++; s_.match_lock_time++;
#endif #endif

View File

@ -99,6 +99,8 @@ namespace mt
int box_open_delay = 0; int box_open_delay = 0;
int compose_mode = 1; int compose_mode = 1;
float sand_table_move_speed = 500;
}; };
static void StaticPostInit(); static void StaticPostInit();
static const S& s() { return s_; }; static const S& s() { return s_; };

View File

@ -172,6 +172,9 @@ void Player::InternalUpdate(int delta_time)
if (!GlmHelper::IsEqual2D(*sand_table_target_pos, GetPos().ToGlmVec3())) { if (!GlmHelper::IsEqual2D(*sand_table_target_pos, GetPos().ToGlmVec3())) {
moving = true; moving = true;
moved_frames = 0; moved_frames = 0;
} else {
moving = false;
GetMovement()->ClearPath();
} }
} else { } else {
moving = false; moving = false;