Sheep model update. Fix broken walking.
This commit is contained in:
parent
021a7f5423
commit
872b9f258f
16
init.lua
16
init.lua
@ -163,7 +163,6 @@ drivers.roam = {
|
|||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
if vector.distance(pos, state.roam_target) < 1.0 then
|
if vector.distance(pos, state.roam_target) < 1.0 then
|
||||||
-- arrived (close enough!
|
-- arrived (close enough!
|
||||||
print("arrived")
|
|
||||||
state.roam_ttl = 0
|
state.roam_ttl = 0
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -174,18 +173,20 @@ drivers.roam = {
|
|||||||
local i, v = next(state.roam_path, nil)
|
local i, v = next(state.roam_path, nil)
|
||||||
if not i then
|
if not i then
|
||||||
-- pathing failed
|
-- pathing failed
|
||||||
state.roam_path = nil
|
state.roam_ttl = 0
|
||||||
state.roam_idle = true
|
|
||||||
state.roam_move = nil
|
|
||||||
self.object:setvelocity(vector.new())
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if vector.distance(pos, v) < 0.3 then
|
if vector.distance(pos, v) < 0.3 then
|
||||||
-- remove one
|
-- remove one
|
||||||
state.roam_path[i] = nil
|
|
||||||
--FIXME shouldn't return here
|
--FIXME shouldn't return here
|
||||||
|
local j = i
|
||||||
|
local i, v = next(state.roam_path, i)
|
||||||
|
if not v then
|
||||||
|
state.roam_path[j] = nil
|
||||||
|
state.roam_ttl = 0
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
-- prune path more?
|
-- prune path more?
|
||||||
local ii, vv = next(state.roam_path, i)
|
local ii, vv = next(state.roam_path, i)
|
||||||
local iii, vvv = next(state.roam_path, ii)
|
local iii, vvv = next(state.roam_path, ii)
|
||||||
@ -280,7 +281,6 @@ drivers.roam = {
|
|||||||
print("no path found!")
|
print("no path found!")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
print("going to: " .. dump(pick))
|
|
||||||
minetest.add_particle({
|
minetest.add_particle({
|
||||||
pos = {x = pick.x, y = pick.y - 0.1, z = pick.z},
|
pos = {x = pick.x, y = pick.y - 0.1, z = pick.z},
|
||||||
velocity = vector.new(),
|
velocity = vector.new(),
|
||||||
@ -491,7 +491,7 @@ local sheep_script = {
|
|||||||
},
|
},
|
||||||
idle = {
|
idle = {
|
||||||
nil,
|
nil,
|
||||||
{{x = 111, y = 119}, frame_speed = 10, frame_loop = true},
|
{{x = 111, y = 129}, frame_speed = 10, frame_loop = true},
|
||||||
nil
|
nil
|
||||||
},
|
},
|
||||||
eat = {
|
eat = {
|
||||||
|
BIN
models/sheep.b3d
BIN
models/sheep.b3d
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user