Author: noyga
Date: Fri Apr 4 00:13:53 2008
New Revision: 25511
URL: http://svn.gna.org/viewcvs/wesnoth?rev=25511&view=rev
Log:
Implement FR #11375 : Make storing locations also store ownership info
Affected tags : [store_starting_location], [store_villages], [store_locations]
Modified:
trunk/src/game_events.cpp
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=25511&r1=25510&r2=25511&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Fri Apr 4 00:13:53 2008
@@ -2501,6 +2501,12 @@
loc_store.clear();
loc.write(loc_store);
game_map->write_terrain(loc, loc_store);
+ if (game_map->is_village(loc)) {
+ std::stringstream sd;
+ int side = village_owner(loc,*teams) + 1;
+ sd << side;
+ loc_store["owner_side"]= sd.str();
+ }
}
/* [store_villages] : store villages into an array
@@ -2536,6 +2542,10 @@
config &loc_store =
to_store.add_child(varinfo.key);
j->write(loc_store);
game_map->write_terrain(*j, loc_store);
+ std::stringstream sd;
+ int side = village_owner(*j,*teams) + 1;
+ sd << side;
+ loc_store["owner_side"]= sd.str();
}
}
varinfo.vars->clear_children(varinfo.key);
@@ -2559,6 +2569,12 @@
config &loc_store =
state_of_game->add_variable_cfg(variable);
j->write(loc_store);
game_map->write_terrain(*j, loc_store);
+ if (game_map->is_village(*j)) {
+ std::stringstream sd;
+ int side = village_owner(*j,*teams) + 1;
+ sd << side;
+ loc_store["owner_side"]= sd.str();
+ }
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits