bobbens/naev — pull request #76 by nikai3d (2012-08-20 12:49:19+00:00)
Title: Avoid multiple update timer instances on Dvaered patrols

Landing on planets during Dvaered patrols may create additional update
timer instances, which cause Lua warnings at the end of the mission, like

Warning: [misn_runFunc] Mission 'Dvaered Patrol' -> 'updateGoal': [string "dat/missions/dvaered/dv_patrol.lua"]:353: attempt to index field '?' (a nil value)
stack traceback:
[string "dat/missions/dvaered/dv_patrol.lua"]:353: in function <[string "dat/missions/dvaered/dv_patrol.lua"]:352>
Warning: [hook_runMisn] Hook [timer] '1747' -> 'updateGoal' failed

In order to restrict the update timer to a single instance, I'd propose
to store the timer ID, and remove an already existing instance on enter()
similar to the way this is done in proximity.lua.