From 4f02417442109656263366ffcefd68231a0da7e9 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Tue, 31 Mar 2009 03:08:39 +0000 Subject: [2722438] Fixing crash when viewing shop contents. shop_item* was being blindly casted to monsters*, which didn't play well with a non-existent virtual function table. Fixed by creating a ShopItemEntry and a MonstersMenuEntry class to differentiate the meaning of MenuEntry::data and to avoid crashes in the future by having MenuEntry::get_tiles() be a no-op. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9572 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/stash.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/stash.h') diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h index 4b3811ec05..d14b67173e 100644 --- a/crawl-ref/source/stash.h +++ b/crawl-ref/source/stash.h @@ -145,6 +145,13 @@ public: bool isAt(int xp, int yp) const { return x == xp && y == yp; } + // Messy! + struct shop_item + { + item_def item; + unsigned price; + }; + private: int x, y; std::string name; @@ -154,12 +161,6 @@ private: // Set true if the player has visited this shop bool visited; - // Messy! - struct shop_item - { - item_def item; - unsigned price; - }; std::vector items; std::string shop_item_name(const shop_item &si) const; -- cgit v1.2.3-54-g00ecf