Renamed "current_tod" attribute of [time_area] to match the global one.

"current_tod" and "current_time" served the same purpose, one at
scenario toplevel, the other inside of [time_area].

For the sake of consistency and for enabling the usage of the same
schedule macros in both cases, they are now both called "current_time".
This commit is contained in:
fendrin 2013-12-20 04:45:18 +01:00
parent de239ae2e5
commit 91b5a57449
2 changed files with 6 additions and 7 deletions

View file

@ -45,7 +45,7 @@ Xu , Xu , Qxu , Qxu , Ql , Ql
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}
current_tod=3
current_time=3
victory_music="loyalists.ogg,underground.ogg,revelation.ogg"
defeat_music="sad.ogg"
@ -1476,7 +1476,6 @@ My best advancement costs $next_cost gold and Im $experience|% there."
x,y=8,11
id=test_area
{DEFAULT_SCHEDULE_24H}
current_tod=12
current_time=13
[/time_area]
[/event]

View file

@ -49,7 +49,7 @@ tod_manager::tod_manager(const config& scenario_cfg, const int num_turns):
//Very bad, since we're pretending to not modify the cfg. Needed to transfer the result
//to the network clients in a mp game, otherwise we have OOS.
config& non_const_config = const_cast<config&>(scenario_cfg);
non_const_config["current_tod"] = currentTime_;
non_const_config["current_time"] = currentTime_;
}
tod_manager& tod_manager::operator=(const tod_manager& manager)
@ -73,7 +73,7 @@ config tod_manager::to_config() const
config cfg;
cfg["turn_at"] = turn_;
cfg["turns"] = num_turns_;
cfg["current_tod"] = currentTime_;
cfg["current_time"] = currentTime_;
std::vector<time_of_day>::const_iterator t;
for(t = times_.begin(); t != times_.end(); ++t) {
@ -303,10 +303,10 @@ void tod_manager::remove_time_area(const std::string& area_id)
int tod_manager::get_start_ToD(const config &level) const
{
const config::attribute_value& current_tod = level["current_tod"];
if (!current_tod.blank())
const config::attribute_value& current_time = level["current_time"];
if (!current_time.blank())
{
return calculate_current_time(times_.size(), turn_, current_tod.to_int(0), true);
return calculate_current_time(times_.size(), turn_, current_time.to_int(0), true);
}
const int default_result = calculate_current_time(times_.size(), turn_, currentTime_);