Number of "rockets sent" reset to 1 if score window deleted
Posted: Sat Jun 11, 2016 10:45 pm
if you delete the rocket score window (by console, or by a mod), at the next rocket you launch, the window is reopened but the score is set to 1. You must wait the next launch to see a correct score.
This could be corrected in the control.lua of the map (rocket event) :
should better be :
This could be corrected in the control.lua of the map (rocket event) :
Code: Select all
for index, player in pairs(force.players) do
if player.gui.left.rocket_score == nil then
local frame = player.gui.left.add{name = "rocket_score", type = "frame", direction = "horizontal", caption={"score"}}
frame.add{name="rocket_count_label", type = "label", caption={"", {"rockets-sent"}, ""}}
frame.add{name="rocket_count", type = "label", caption="1"} -- PROBLEM
else
player.gui.left.rocket_score.rocket_count.caption = tostring(global.satellite_sent[force.name])
end
end
Code: Select all
for index, player in pairs(force.players) do
if player.gui.left.rocket_score == nil then
local frame = player.gui.left.add{name = "rocket_score", type = "frame", direction = "horizontal", caption={"score"}}
frame.add{name="rocket_count_label", type = "label", caption={"", {"rockets-sent"}, ""}}
frame.add{name="rocket_count", type = "label", caption=tostring(global.satellite_sent[force.name])}
else
player.gui.left.rocket_score.rocket_count.caption = tostring(global.satellite_sent[force.name])
end
end