mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-09 21:34:01 +00:00
Hopefully fixed piranha pet script warning (thx `Nax for reporting)
This commit is contained in:
parent
6962a3e3ab
commit
84a73b59f9
1 changed files with 15 additions and 11 deletions
|
@ -132,6 +132,7 @@ function update(me, dt)
|
||||||
|
|
||||||
if entity_hasTarget(me) then
|
if entity_hasTarget(me) then
|
||||||
target = entity_getTarget(me)
|
target = entity_getTarget(me)
|
||||||
|
if target ~= 0 then
|
||||||
--[[
|
--[[
|
||||||
ox, oy = entity_getOffset(target)
|
ox, oy = entity_getOffset(target)
|
||||||
cx = entity_x(target) + ox + entity_velx(target)
|
cx = entity_x(target) + ox + entity_velx(target)
|
||||||
|
@ -141,6 +142,7 @@ function update(me, dt)
|
||||||
cx = cx + entity_velx(target)
|
cx = cx + entity_velx(target)
|
||||||
cy = cy + entity_vely(target)
|
cy = cy + entity_vely(target)
|
||||||
dist = 40
|
dist = 40
|
||||||
|
end
|
||||||
|
|
||||||
--debugLog(string.format("distTimer: %f", v.distTimer))
|
--debugLog(string.format("distTimer: %f", v.distTimer))
|
||||||
v.distTimer = v.distTimer + dt * 0.5
|
v.distTimer = v.distTimer + dt * 0.5
|
||||||
|
@ -160,8 +162,10 @@ function update(me, dt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if target ~= 0 then
|
||||||
entity_flipToEntity(me, target)
|
entity_flipToEntity(me, target)
|
||||||
entity_rotateToEntity(me, target)
|
entity_rotateToEntity(me, target)
|
||||||
|
end
|
||||||
|
|
||||||
local a = t
|
local a = t
|
||||||
x = x + math.sin(a)*dist
|
x = x + math.sin(a)*dist
|
||||||
|
|
Loading…
Add table
Reference in a new issue