← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~mquinson/widelands/cleanup-MilitarySiteDesc into lp:widelands

 

Martin Quinson has proposed merging lp:~mquinson/widelands/cleanup-MilitarySiteDesc into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~mquinson/widelands/cleanup-MilitarySiteDesc/+merge/210080

This is a small cleanup reducing the amount of dupplicated data in memory.

This is my first patch on launchpad, so please be patient ;)

(I'm emptty on IRC)
-- 
https://code.launchpad.net/~mquinson/widelands/cleanup-MilitarySiteDesc/+merge/210080
Your team Widelands Developers is requested to review the proposed merge of lp:~mquinson/widelands/cleanup-MilitarySiteDesc into lp:widelands.
=== modified file 'src/logic/militarysite.cc'
--- src/logic/militarysite.cc	2014-03-05 18:46:29 +0000
+++ src/logic/militarysite.cc	2014-03-09 09:43:03 +0000
@@ -93,11 +93,6 @@
 m_capacity    (ms_descr.get_max_number_of_soldiers()),
 m_nexthealtime(0),
 m_soldier_preference(ms_descr.m_prefers_heroes_at_start ? kPrefersHeroes : kPrefersRookies),
-m_occupied_str(ms_descr.m_occupied_str),
-m_aggressor_str(ms_descr.m_aggressor_str),
-m_attack_str(ms_descr.m_attack_str),
-m_defeated_enemy_str(ms_descr.m_defeated_enemy_str),
-m_defeated_you_str(ms_descr.m_defeated_you_str),
 m_soldier_upgrade_try(false),
 m_doing_upgrade_request(false)
 {
@@ -250,7 +245,7 @@
 				(*game,
 				 "site_occupied",
 				 descname(),
-				 m_occupied_str,
+				 descr().m_occupied_str,
 				 true);
 		}
 	}
@@ -846,7 +841,7 @@
 				(game,
 				 "site_lost",
 				 _("Militarysite lost!"),
-				 m_defeated_enemy_str,
+				 descr().m_defeated_enemy_str,
 				 false);
 		}
 
@@ -900,7 +895,7 @@
 			(game,
 			 "site_defeated",
 			 _("Enemy at site defeated!"),
-			 newsite->m_defeated_you_str,
+			 newsite->descr().m_defeated_you_str,
 			 true);
 
 		return false;
@@ -946,7 +941,7 @@
 		(game,
 		 "under_attack",
 		 _("You are under attack"),
-		 discovered ? m_aggressor_str : m_attack_str,
+		 discovered ? descr().m_aggressor_str : descr().m_attack_str,
 		 false,
 		 60 * 1000, 5);
 }

=== modified file 'src/logic/militarysite.h'
--- src/logic/militarysite.h	2014-03-03 20:50:30 +0000
+++ src/logic/militarysite.h	2014-03-09 09:43:03 +0000
@@ -170,11 +170,6 @@
 	};
 	std::vector<SoldierJob> m_soldierjobs;
 	SoldierPreference m_soldier_preference;
-	std::string m_occupied_str;
-	std::string m_aggressor_str;
-	std::string m_attack_str;
-	std::string m_defeated_enemy_str;
-	std::string m_defeated_you_str;
 	int32_t m_next_swap_soldiers_time;
 	bool m_soldier_upgrade_try; // optimization -- if everybody is zero-level, do not downgrade
 	bool m_doing_upgrade_request;


Follow ups