mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-15 14:09:06 +00:00
Fix possible dangling pointer / crash in predatorytunicate script
This commit is contained in:
parent
aab0dad1cb
commit
b4906a3840
1 changed files with 18 additions and 17 deletions
|
@ -144,13 +144,13 @@ function update(me, dt)
|
|||
end
|
||||
]]--
|
||||
|
||||
if entity_isState(me, STATE_TRAP) and v.trappedEnt ~= 0 then
|
||||
entity_setPosition(v.trappedEnt, v.hx, v.hy, 0.1)
|
||||
if v.trappedEnt ~= 0 then
|
||||
if entity_isDead(v.trappedEnt) then
|
||||
v.trappedEnt = 0
|
||||
entity_setState(me, STATE_IDLE)
|
||||
end
|
||||
elseif entity_isState(me, STATE_TRAPPED) and v.trappedEnt ~= 0 then
|
||||
elseif entity_isState(me, STATE_TRAP) then
|
||||
entity_setPosition(v.trappedEnt, v.hx, v.hy, 0.1)
|
||||
elseif entity_isState(me, STATE_TRAPPED) then
|
||||
entity_setPosition(v.trappedEnt, v.hx, v.hy)
|
||||
v.hurtTimer = v.hurtTimer + dt
|
||||
if v.hurtTimer > 1 then
|
||||
|
@ -167,6 +167,7 @@ function update(me, dt)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function enterState(me)
|
||||
if entity_isState(me, STATE_IDLE) then
|
||||
|
|
Loading…
Reference in a new issue