Comment 3 for bug 536458

Revision history for this message
Sigra (sigra) wrote :

Logged In: YES
user_id=31104
Originator: NO

The following change should fix your problem, although there is still the problem that the editor does not set the nodes as seen when it creates the headquarter, so now Test1 loaded as scenario does not show anything. But i guess you already noticed this when looking at Test2, where it is apparent that only the area around the second headquarter (created when starting the game) is revealed.
--- src/player.cc (revision 2046)
+++ src/player.cc (arbetskopia)
@@ -85,14 +85,19 @@
        if (place_headquarters) {
                const Tribe_Descr & trdesc = m_tribe;
                const int plnum = m_plnum;
+ const Coords starting_pos = map.get_starting_pos(plnum);
+ Warehouse * const warehouse =
+ dynamic_cast<Warehouse * const>(map.get_immovable(starting_pos));
                //try {
                        trdesc.load_warehouse_with_start_wares
                                (egbase(),
- *dynamic_cast<Warehouse * const>
- (egbase().warp_building
- (map.get_starting_pos(plnum),
- plnum,
- trdesc.get_building_index("headquarters"))));
+ *(warehouse ?
+ warehouse :
+ dynamic_cast<Warehouse * const>
+ (egbase().warp_building
+ (starting_pos,
+ plnum,
+ trdesc.get_building_index("headquarters")))));
                //} catch (const Descr_Maintainer<Building_Descr>::Nonexistent) {
                        //throw wexception("Tribe %s lacks headquarters", tribe.get_name());
                //}