[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.
|
else -- Default english.
|
||||||
misn_title = "Empire Recruitment"
|
misn_title = "Empire Recruitment"
|
||||||
misn_reward = "%d credits"
|
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 = {}
|
||||||
title[1] = "Spaceport Bar"
|
title[1] = "Spaceport Bar"
|
||||||
title[2] = "Empire Recruitment"
|
title[2] = "Empire Recruitment"
|
||||||
@ -30,6 +30,8 @@ function create()
|
|||||||
if i > 10 then
|
if i > 10 then
|
||||||
misn.finish(false)
|
misn.finish(false)
|
||||||
end
|
end
|
||||||
|
system = space.getSystem(dest)
|
||||||
|
misn.setMarker(system)
|
||||||
|
|
||||||
-- Intro text.
|
-- Intro text.
|
||||||
tk.msg(title[1], text[1])
|
tk.msg(title[1], text[1])
|
||||||
@ -41,7 +43,7 @@ function create()
|
|||||||
reward = 3000
|
reward = 3000
|
||||||
misn.setTitle(misn_title)
|
misn.setTitle(misn_title)
|
||||||
misn.setReward(string.format(misn_reward, reward))
|
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.
|
-- Flavour text and mini-briefing.
|
||||||
tk.msg(title[2], string.format( text[3], dest))
|
tk.msg(title[2], string.format( text[3], dest))
|
||||||
|
@ -38,6 +38,7 @@ function create()
|
|||||||
misn_target = "Dune"
|
misn_target = "Dune"
|
||||||
misn_base = "Omega Station"
|
misn_base = "Omega Station"
|
||||||
misn_base_sys = "NCG-7291"
|
misn_base_sys = "NCG-7291"
|
||||||
|
misn.setMarker(misn_nearby) -- Not exact target.
|
||||||
|
|
||||||
-- Mission details.
|
-- Mission details.
|
||||||
misn.setTitle(misn_title)
|
misn.setTitle(misn_title)
|
||||||
@ -70,6 +71,7 @@ function enter()
|
|||||||
if misn_stage == 0 and sys == misn_target then
|
if misn_stage == 0 and sys == misn_target then
|
||||||
misn.setDesc(string.format(misn_desc[2],misn_base,misn_base_sys))
|
misn.setDesc(string.format(misn_desc[2],misn_base,misn_base_sys))
|
||||||
misn_stage = 1
|
misn_stage = 1
|
||||||
|
misn.setMarker(misn_base_sys) -- Now we mark return to base.
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ function create()
|
|||||||
misn.finish(false)
|
misn.finish(false)
|
||||||
end
|
end
|
||||||
system = space.getSystem( planet )
|
system = space.getSystem( planet )
|
||||||
|
misn.setMarker(system) -- Set system marker.
|
||||||
misn_dist = space.jumpDist(system)
|
misn_dist = space.jumpDist(system)
|
||||||
|
|
||||||
-- Mission generics.
|
-- Mission generics.
|
||||||
|
@ -370,14 +370,18 @@ static int misn_setReward(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int misn_setMarker(lua_State* L) {
|
static int misn_setMarker(lua_State* L) {
|
||||||
LLUA_MIN_ARGS(1);
|
|
||||||
if(lua_isstring(L, 1)) {
|
if(lua_isstring(L, 1)) {
|
||||||
if(cur_mission->sys_marker != NULL) /* Cleanup old markers. */
|
if(cur_mission->sys_marker != NULL) /* Cleanup old markers. */
|
||||||
free(cur_mission->sys_marker);
|
free(cur_mission->sys_marker);
|
||||||
cur_mission->sys_marker = strdup((char*)lua_tostring(L, 1));
|
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();
|
mission_sysMark();
|
||||||
}
|
}
|
||||||
else LLUA_INVALID_PARAMETER();
|
else if(cur_mission->sys_marker != NULL) /* No parameter nullifies. */
|
||||||
|
free(cur_mission->sys_marker);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user