[Add] More debug magicz for misn_lua.
This commit is contained in:
parent
692fb388df
commit
a041751ec1
@ -4,7 +4,7 @@ if lang == "es" then
|
||||
else -- Default english.
|
||||
misn_title = "Empire Recruitment"
|
||||
misn_reward = "%d credits"
|
||||
misn_desc = "Deliver some parcels for the Empire to %s."
|
||||
misn_desc = "Deliver some parcels for the Empire to %s in %s."
|
||||
title = {}
|
||||
title[1] = "Spaceport Bar"
|
||||
title[2] = "Empire Recruitment"
|
||||
@ -30,6 +30,8 @@ function create()
|
||||
if i > 10 then
|
||||
misn.finish(false)
|
||||
end
|
||||
system = space.getSystem(dest)
|
||||
misn.setMarker(system)
|
||||
|
||||
-- Intro text.
|
||||
tk.msg(title[1], text[1])
|
||||
@ -41,7 +43,7 @@ function create()
|
||||
reward = 3000
|
||||
misn.setTitle(misn_title)
|
||||
misn.setReward(string.format(misn_reward, reward))
|
||||
misn.setDesc(string.format(misn_desc,dest))
|
||||
misn.setDesc(string.format(misn_desc,dest, system))
|
||||
|
||||
-- Flavour text and mini-briefing.
|
||||
tk.msg(title[2], string.format( text[3], dest))
|
||||
|
@ -38,6 +38,7 @@ function create()
|
||||
misn_target = "Dune"
|
||||
misn_base = "Omega Station"
|
||||
misn_base_sys = "NCG-7291"
|
||||
misn.setMarker(misn_nearby) -- Not exact target.
|
||||
|
||||
-- Mission details.
|
||||
misn.setTitle(misn_title)
|
||||
@ -70,6 +71,7 @@ function enter()
|
||||
if misn_stage == 0 and sys == misn_target then
|
||||
misn.setDesc(string.format(misn_desc[2],misn_base,misn_base_sys))
|
||||
misn_stage = 1
|
||||
misn.setMarker(misn_base_sys) -- Now we mark return to base.
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,6 +36,7 @@ function create()
|
||||
misn.finish(false)
|
||||
end
|
||||
system = space.getSystem( planet )
|
||||
misn.setMarker(system) -- Set system marker.
|
||||
misn_dist = space.jumpDist(system)
|
||||
|
||||
-- Mission generics.
|
||||
|
@ -370,14 +370,18 @@ static int misn_setReward(lua_State* L) {
|
||||
}
|
||||
|
||||
static int misn_setMarker(lua_State* L) {
|
||||
LLUA_MIN_ARGS(1);
|
||||
if(lua_isstring(L, 1)) {
|
||||
if(cur_mission->sys_marker != NULL) /* Cleanup old markers. */
|
||||
free(cur_mission->sys_marker);
|
||||
cur_mission->sys_marker = strdup((char*)lua_tostring(L, 1));
|
||||
#ifdef DEBUG
|
||||
if(system_get(cur_mission->sys_marker)==NULL)
|
||||
LLUA_DEBUG("Marking unexistant system '%s'", cur_mission->sys_marker);
|
||||
#endif
|
||||
mission_sysMark();
|
||||
}
|
||||
else LLUA_INVALID_PARAMETER();
|
||||
else if(cur_mission->sys_marker != NULL) /* No parameter nullifies. */
|
||||
free(cur_mission->sys_marker);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user