[Fix] Bug in ze missionz
This commit is contained in:
parent
9cebbe7f7a
commit
83d3fbf07c
@ -13,7 +13,7 @@ function create()
|
||||
|
||||
-- Missions generic.
|
||||
misn_type = "Cargo"
|
||||
i = rnd.int(0, 3)
|
||||
i = rnd.int(3)
|
||||
if i == 0 then
|
||||
misn.setTitle("Cargo Delivery to " .. planet)
|
||||
elseif i == 1 then
|
||||
@ -26,11 +26,14 @@ function create()
|
||||
|
||||
-- More mission specifics.
|
||||
carg_mass = rnd.int(10, 30)
|
||||
carg_type = "Food"
|
||||
i = rnd.int(1)
|
||||
if i == 0 then carg_type = "Food"
|
||||
elseif i == 1 then carg_type = "Ore"
|
||||
end
|
||||
misn.setDesc(string.format(
|
||||
"%s needs a rush delivery of %d tons of %s by %s.",
|
||||
planet, carg_mass, carg_type, "SOMEDAY"))
|
||||
misn_reward = carg_mass * 1000 + rnd.int(0, 5000)
|
||||
"%s needs a delivery of %d tons of %s.",
|
||||
planet, carg_mass, carg_type))
|
||||
misn_reward = carg_mass * (750 + rnd.int(250)) + rnd.int(5000)
|
||||
misn.setReward(string.format("%d Scred", misn_reward))
|
||||
end
|
||||
|
||||
|
@ -248,7 +248,7 @@ static int space_getPlanet(lua_State* L) {
|
||||
free(planets);
|
||||
return 0;;
|
||||
}
|
||||
rndplanet = planets[RNG(0, nplanets)];
|
||||
rndplanet = planets[RNG(0, nplanets-1)];
|
||||
free(planets);
|
||||
|
||||
lua_pushstring(L, rndplanet);
|
||||
|
Loading…
Reference in New Issue
Block a user