From 4c9837c15ab8fe9fb77f81bd8b325a21c8608021 Mon Sep 17 00:00:00 2001 From: Marek Moeckel Date: Mon, 23 May 2005 17:14:43 +0000 Subject: [PATCH] fixed critical telephone bug (thanks for noticing, Matze) SVN-Revision: 2542 --- src/object/infoblock.cpp | 8 ++++++-- src/object/infoblock.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/object/infoblock.cpp b/src/object/infoblock.cpp index 2eb7ca2b6..55e2e3041 100644 --- a/src/object/infoblock.cpp +++ b/src/object/infoblock.cpp @@ -39,8 +39,9 @@ InfoBlock::InfoBlock(const lisp::Lisp& lisp) if(!lisp.get("message", message)) { std::cerr << "No message in InfoBlock!\n"; } + stopped = false; ringing = new AmbientSound(get_pos(), 0.5, 300, 1, "phone"); - Sector::current()->add_object(ringing); + Sector::current()->add_object(ringing); } InfoBlock::~InfoBlock() @@ -52,7 +53,10 @@ InfoBlock::hit(Player& ) { GameSession::current()->display_info_box(message); start_bounce(); - ringing->remove_me(); + if (!stopped) { + ringing->remove_me(); + stopped = true; + } } IMPLEMENT_FACTORY(InfoBlock, "infoblock") diff --git a/src/object/infoblock.h b/src/object/infoblock.h index 9f6a670ae..d67cb8184 100644 --- a/src/object/infoblock.h +++ b/src/object/infoblock.h @@ -34,6 +34,7 @@ protected: virtual void hit(Player& player); std::string message; AmbientSound* ringing; + bool stopped; }; #endif -- 2.11.0