← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/remove_headquarters into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/remove_headquarters into lp:widelands.

Commit message:
Removed the headquarters() function from TribeDescr. It was only there for an uncompleted editor feature that has since been ripped out, and it doesn't do what it should anyway.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/remove_headquarters/+merge/334212
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/remove_headquarters into lp:widelands.
=== modified file 'data/tribes/atlanteans.lua'
--- data/tribes/atlanteans.lua	2017-07-19 20:40:32 +0000
+++ data/tribes/atlanteans.lua	2017-11-23 19:15:09 +0000
@@ -44,8 +44,6 @@
 --
 --    **ship**: The internal name of the tribe's ship.
 --
---    **headquarters**: The internal name of the tribe's headquarters building. This unit needs to be defined in the ``buildings`` table too.
---
 --    **port**: The internal name of the tribe's port building. This unit needs to be defined in the ``buildings`` table too.
 tribes:new_tribe {
    name = "atlanteans",
@@ -349,7 +347,6 @@
    geologist = "atlanteans_geologist",
    soldier = "atlanteans_soldier",
    ship = "atlanteans_ship",
-   headquarters = "atlanteans_headquarters",
    port = "atlanteans_port",
    barracks = "atlanteans_barracks",
    ironore = "iron_ore",

=== modified file 'data/tribes/barbarians.lua'
--- data/tribes/barbarians.lua	2017-09-15 12:33:58 +0000
+++ data/tribes/barbarians.lua	2017-11-23 19:15:09 +0000
@@ -285,7 +285,6 @@
    geologist = "barbarians_geologist",
    soldier = "barbarians_soldier",
    ship = "barbarians_ship",
-   headquarters = "barbarians_headquarters",
    port = "barbarians_port",
    barracks = "barbarians_barracks",
    ironore = "iron_ore",

=== modified file 'data/tribes/empire.lua'
--- data/tribes/empire.lua	2017-07-19 20:40:32 +0000
+++ data/tribes/empire.lua	2017-11-23 19:15:09 +0000
@@ -323,7 +323,6 @@
    geologist = "empire_geologist",
    soldier = "empire_soldier",
    ship = "empire_ship",
-   headquarters = "empire_headquarters",
    port = "empire_port",
    barracks = "empire_barracks",
    ironore = "iron_ore",

=== modified file 'src/logic/map_objects/tribes/tribe_descr.cc'
--- src/logic/map_objects/tribes/tribe_descr.cc	2017-07-19 20:40:32 +0000
+++ src/logic/map_objects/tribes/tribe_descr.cc	2017-11-23 19:15:09 +0000
@@ -241,7 +241,6 @@
 			throw GameDataError("Failed adding ship '%s': %s", shipname.c_str(), e.what());
 		}
 
-		headquarters_ = add_special_building(table.get_string("headquarters"));
 		port_ = add_special_building(table.get_string("port"));
 		barracks_ = add_special_building(table.get_string("barracks"));
 
@@ -362,10 +361,6 @@
 	assert(tribes_.ship_exists(ship_));
 	return ship_;
 }
-DescriptionIndex TribeDescr::headquarters() const {
-	assert(tribes_.building_exists(headquarters_));
-	return headquarters_;
-}
 DescriptionIndex TribeDescr::port() const {
 	assert(tribes_.building_exists(port_));
 	return port_;

=== modified file 'src/logic/map_objects/tribes/tribe_descr.h'
--- src/logic/map_objects/tribes/tribe_descr.h	2017-07-19 20:40:32 +0000
+++ src/logic/map_objects/tribes/tribe_descr.h	2017-11-23 19:15:09 +0000
@@ -101,7 +101,6 @@
 	DescriptionIndex geologist() const;
 	DescriptionIndex soldier() const;
 	DescriptionIndex ship() const;
-	DescriptionIndex headquarters() const;
 	DescriptionIndex port() const;
 	DescriptionIndex barracks() const;
 	DescriptionIndex ironore() const;
@@ -189,7 +188,6 @@
 	DescriptionIndex geologist_;     // This tribe's geologist worker
 	DescriptionIndex soldier_;       // The soldier that this tribe uses
 	DescriptionIndex ship_;          // The ship that this tribe uses
-	DescriptionIndex headquarters_;  // The tribe's default headquarters, needed by the editor
 	DescriptionIndex port_;          // The port that this tribe uses
 	DescriptionIndex barracks_;      // The barracks to create soldiers
 	DescriptionIndex ironore_;       // Iron ore

=== modified file 'src/scripting/lua_map.cc'
--- src/scripting/lua_map.cc	2017-11-10 09:31:46 +0000
+++ src/scripting/lua_map.cc	2017-11-23 19:15:09 +0000
@@ -1324,7 +1324,6 @@
    PROP_RO(LuaTribeDescription, carrier2),
    PROP_RO(LuaTribeDescription, descname),
    PROP_RO(LuaTribeDescription, geologist),
-   PROP_RO(LuaTribeDescription, headquarters),
    PROP_RO(LuaTribeDescription, name),
    PROP_RO(LuaTribeDescription, port),
    PROP_RO(LuaTribeDescription, ship),
@@ -1417,17 +1416,6 @@
 }
 
 /* RST
-   .. attribute:: headquarters
-
-         (RO) the :class:`string` internal name of the default headquarters type that this tribe uses
-*/
-
-int LuaTribeDescription::get_headquarters(lua_State* L) {
-	lua_pushstring(L, get_egbase(L).tribes().get_building_descr(get()->headquarters())->name());
-	return 1;
-}
-
-/* RST
    .. attribute:: name
 
          (RO) a :class:`string` with the tribe's internal name

=== modified file 'src/scripting/lua_map.h'
--- src/scripting/lua_map.h	2017-09-22 19:54:27 +0000
+++ src/scripting/lua_map.h	2017-11-23 19:15:09 +0000
@@ -129,7 +129,6 @@
 	int get_carrier(lua_State*);
 	int get_carrier2(lua_State*);
 	int get_descname(lua_State*);
-	int get_headquarters(lua_State*);
 	int get_geologist(lua_State*);
 	int get_name(lua_State*);
 	int get_port(lua_State*);

=== modified file 'test/maps/lua_testsuite.wmf/scripting/tribes_descriptions.lua'
--- test/maps/lua_testsuite.wmf/scripting/tribes_descriptions.lua	2017-09-15 17:54:59 +0000
+++ test/maps/lua_testsuite.wmf/scripting/tribes_descriptions.lua	2017-11-23 19:15:09 +0000
@@ -58,11 +58,6 @@
    assert_equal("atlanteans_horse", tribe.carrier2)
 end
 
-function test_descr:test_get_headquarters()
-   local tribe = egbase:get_tribe_description("atlanteans")
-   assert_equal("atlanteans_headquarters", tribe.headquarters)
-end
-
 function test_descr:test_get_geologist()
    local tribe = egbase:get_tribe_description("atlanteans")
    assert_equal("atlanteans_geologist", tribe.geologist)


References