1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-06-08 01:22:02 +00:00

Hopefully fixed piranha pet script warning (thx `Nax for reporting)

This commit is contained in:
fgenesis 2013-06-19 02:26:12 +02:00
parent 6962a3e3ab
commit 84a73b59f9

View file

@ -132,15 +132,17 @@ 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) --[[
cx = entity_x(target) + ox + entity_velx(target) ox, oy = entity_getOffset(target)
cy = entity_y(target) + oy + entity_vely(target) cx = entity_x(target) + ox + entity_velx(target)
]]-- cy = entity_y(target) + oy + entity_vely(target)
cx, cy = entity_getTargetPoint(target, v.tpoint) ]]--
cx = cx + entity_velx(target) cx, cy = entity_getTargetPoint(target, v.tpoint)
cy = cy + entity_vely(target) cx = cx + entity_velx(target)
dist = 40 cy = cy + entity_vely(target)
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
entity_flipToEntity(me, target) if target ~= 0 then
entity_rotateToEntity(me, target) entity_flipToEntity(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