Skip to content

Commit fc3f55f

Browse files
committed
FIX: Do not change underground mode when scrolling from the minimap
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11635 8aca7d54-2c30-db11-9de9-000461428c89
1 parent 14b7763 commit fc3f55f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

simutrans/history.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
CHG: option for pakset dump versus all other debug by appending 'p' to the debug level, e.g. "-debug 0p" to show only pak details
1+
CHG: option for pakset dump versus all other debug by appending 'p' to the debug level, e.g. "-debug 0p" to show only pak details to declutter server logs
22
CHG: tram system type way can be laid over other tracks as well (like pak192 narrowgauge over normal rails)
3-
CHG: bridge builder is now only a two click tool (total reneval) Can not again connect to complex ramps on elevated ways or cross rivers automatically
3+
CHG: bridge builder is now only a two click tool (total reneval) Can again connect to complex ramps on elevated ways or cross rivers automatically
44
FIX: Players gain money by building long stretches of expensive tunnels
55
FIX: Pak files cannot represent cost of vehicles exceeding 2^32-1 Simu-cents
66
FIX: Pak files cannot represent runningcost of vehicles exceeding 2^16-1 Simu-cents
77
FIX: Pak files cannot represent fixed cost of vehicles exceeding 2^32-1 Simu-cents
88
FIX: makro building with way order and stations extensions fixed
99
FIX: Freelist allocated objects (tiles, ways, trees etc.) use 3x more memory than necessary
10+
FIX: Do not change underground mode when scrolling from the minimap
1011

1112

1213
Release of 124.3 (r11590 on 10-Jan-2025):

src/simutrans/display/viewport.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,18 @@ void viewport_t::switch_underground_mode(const koord3d& pos)
121121

122122
// change the center viewport position for a certain ground tile
123123
// any possible convoi to follow will be disabled
124-
void viewport_t::change_world_position( const koord3d& new_ij )
124+
void viewport_t::change_world_position( const koord3d& new_ij, bool automatic_underground)
125125
{
126126
follow_convoi = convoihandle_t();
127-
switch_underground_mode(new_ij);
127+
if (automatic_underground) {
128+
switch_underground_mode(new_ij);
129+
}
128130
change_world_position( get_map2d_coord( new_ij ) );
129131
}
130132

131133

132134
void viewport_t::change_world_position(const koord3d& pos, const koord& off, scr_coord sc)
133135
{
134-
switch_underground_mode(pos);
135136
// see get_viewport_coord and update_cached_values
136137
koord scr_pos_2d = pos.get_2d() - view_ij_off;
137138

src/simutrans/display/viewport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class viewport_t
174174
* Set center viewport position, taking height into account.
175175
* Possibly switches underground mode.
176176
*/
177-
void change_world_position( const koord3d& ij );
177+
void change_world_position( const koord3d& ij, bool automatic_underground = true );
178178

179179
/**
180180
* Set center viewport position, placing a in-game koord3d under the desired screen position.

src/simutrans/gui/minimap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ bool minimap_t::infowin_event(const event_t *ev)
11941194
if(IS_LEFTRELEASE(ev) || ((IS_LEFTCLICK(ev) || IS_LEFTDRAG(ev)) && !env_t::leftdrag_in_minimap)) {
11951195
world->get_viewport()->set_follow_convoi( convoihandle_t() );
11961196
const sint8 min_hgt = world->is_within_grid_limits(k) ? world->min_hgt(k) : 0;
1197-
world->get_viewport()->change_world_position(koord3d(k,min_hgt));
1197+
world->get_viewport()->change_world_position(koord3d(k,min_hgt),false); // change position bu do not touch underground mode
11981198
return true;
11991199
}
12001200

0 commit comments

Comments
 (0)