1
This commit is contained in:
parent
6b19afac51
commit
b8c4d10c27
@ -2366,7 +2366,7 @@ void Creature::UpdateMove()
|
||||
}
|
||||
}
|
||||
room->grid_service->MoveCreature(this);
|
||||
if (a8::HasBitFlag(status, CS_CrazeMode) && IsNearGas()) {
|
||||
if (a8::HasBitFlag(status, CS_CrazeMode) && IsNearGas(100)) {
|
||||
GetMutablePos() = old_pos;
|
||||
GetMovement()->ClearPath();
|
||||
glm::vec3 dir = GetPos().ToGlmVec3() - old_pos.ToGlmVec3();
|
||||
@ -2377,7 +2377,7 @@ void Creature::UpdateMove()
|
||||
GlmHelper::Normalize(dir);
|
||||
SetMoveDir(dir);
|
||||
}
|
||||
} else if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas()) {
|
||||
} else if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas(20)) {
|
||||
GetMutablePos() = old_pos;
|
||||
GetMovement()->ClearPath();
|
||||
glm::vec3 dir = GetPos().ToGlmVec3() - old_pos.ToGlmVec3();
|
||||
@ -2388,7 +2388,7 @@ void Creature::UpdateMove()
|
||||
GlmHelper::Normalize(dir);
|
||||
SetMoveDir(dir);
|
||||
}
|
||||
} else if (room->IsNewBieRoom() && IsNearGas()) {
|
||||
} else if (room->IsNewBieRoom() && IsNearGas(20)) {
|
||||
GetMutablePos() = old_pos;
|
||||
GetMovement()->ClearPath();
|
||||
}
|
||||
@ -2990,12 +2990,12 @@ void Creature::NetInitOk()
|
||||
{
|
||||
}
|
||||
|
||||
bool Creature::IsNearGas()
|
||||
bool Creature::IsNearGas(float distance)
|
||||
{
|
||||
Position p;
|
||||
p.FromGlmVec3(glm::vec3(room->GetGasData().pos_new.x, 0, room->GetGasData().pos_new.y));
|
||||
float distance = GetPos().Distance2D2(p);
|
||||
return distance + GetRadius() * 2 + 20 > room->GetGasData().rad_new;
|
||||
float gas_distance = GetPos().Distance2D2(p);
|
||||
return gas_distance + GetRadius() * 2 + distance > room->GetGasData().rad_new;
|
||||
}
|
||||
|
||||
float Creature::GetSpeed()
|
||||
|
@ -354,7 +354,7 @@ class Creature : public MoveableEntity
|
||||
void ShortFindPath();
|
||||
float GetSkillRaycastDistance();
|
||||
virtual void NetInitOk();
|
||||
bool IsNearGas();
|
||||
bool IsNearGas(float distance);
|
||||
std::shared_ptr<std::set<int>> CalcReporterList(bool is_trace_bullet,
|
||||
const mt::Equip* weapon_meta,
|
||||
const mt::Equip* bullet_meta);
|
||||
|
Loading…
x
Reference in New Issue
Block a user