mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed pet spawning bug
Former-commit-id: 78dcd034940a4de1ce7d66a79d9134be6ee281f2
This commit is contained in:
parent
1209f0393d
commit
e8b6e120dc
@ -201,8 +201,7 @@ impl Client {
|
|||||||
self.state.terrain().iter().for_each(|(key, _)| {
|
self.state.terrain().iter().for_each(|(key, _)| {
|
||||||
if (Vec2::from(chunk_pos) - Vec2::from(key))
|
if (Vec2::from(chunk_pos) - Vec2::from(key))
|
||||||
.map(|e: i32| e.abs())
|
.map(|e: i32| e.abs())
|
||||||
.reduce_max()
|
.reduce_max() > 10
|
||||||
> 6
|
|
||||||
{
|
{
|
||||||
chunks_to_remove.push(key);
|
chunks_to_remove.push(key);
|
||||||
}
|
}
|
||||||
@ -213,7 +212,7 @@ impl Client {
|
|||||||
|
|
||||||
// Request chunks from the server
|
// Request chunks from the server
|
||||||
// TODO: This is really not very efficient
|
// TODO: This is really not very efficient
|
||||||
'outer: for dist in 0..9 {
|
'outer: for dist in 0..10 {
|
||||||
for i in chunk_pos.x - dist..chunk_pos.x + dist + 1 {
|
for i in chunk_pos.x - dist..chunk_pos.x + dist + 1 {
|
||||||
for j in chunk_pos.y - dist..chunk_pos.y + dist + 1 {
|
for j in chunk_pos.y - dist..chunk_pos.y + dist + 1 {
|
||||||
for k in 0..3 {
|
for k in 0..3 {
|
||||||
|
@ -41,7 +41,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
let dist = tgt_pos.distance(pos.0);
|
let dist = tgt_pos.distance(pos.0);
|
||||||
control.move_dir = if dist > 5.0 {
|
control.move_dir = if dist > 5.0 {
|
||||||
Vec2::from(tgt_pos - pos.0).normalized()
|
Vec2::from(tgt_pos - pos.0).normalized()
|
||||||
} else if dist < 1.5 && pos.0 != tgt_pos {
|
} else if dist < 1.5 && dist > 0.0 {
|
||||||
Vec2::from(pos.0 - tgt_pos).normalized()
|
Vec2::from(pos.0 - tgt_pos).normalized()
|
||||||
} else {
|
} else {
|
||||||
Vec2::zero()
|
Vec2::zero()
|
||||||
|
Loading…
Reference in New Issue
Block a user