Skip to content

Commit

Permalink
FIX: city_road tool marked as selected
Browse files Browse the repository at this point in the history
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@3640 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
Dwachs committed Aug 10, 2010
1 parent 8d3d2ef commit 6f030c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simwerkz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,9 @@ const char* wkz_wegebau_t::get_default_param() const

bool wkz_wegebau_t::is_selected( karte_t *welt ) const
{
if (welt->get_werkzeug(welt->get_active_player_nr())->get_id()!=id) {
return false;
}
const wkz_wegebau_t *selected = dynamic_cast<const wkz_wegebau_t *>(welt->get_werkzeug(welt->get_active_player_nr()));
return (selected && selected->get_besch(welt->get_timeline_year_month(),false) == get_besch(welt->get_timeline_year_month(),false));
}
Expand Down
1 change: 1 addition & 0 deletions simwerkz.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class wkz_build_cityroad : public wkz_wegebau_t {
wkz_build_cityroad() : wkz_wegebau_t() { id = WKZ_CITYROAD | GENERAL_TOOL; }
virtual const weg_besch_t *get_besch(uint16,bool) const;
virtual image_id get_icon(spieler_t *sp) const { return werkzeug_t::get_icon(sp); }
virtual bool is_selected( karte_t *welt ) const { return werkzeug_t::is_selected(welt); }
private:
virtual const char *do_work( karte_t *, spieler_t *, const koord3d &, const koord3d & );
};
Expand Down

0 comments on commit 6f030c7

Please sign in to comment.