Fixed a segfault in the tutorial

(game segfaulting when a message with no speaker is issued)
This commit is contained in:
Philippe Plantier 2004-08-05 18:38:50 +00:00
parent 2bac6afceb
commit 98b7a7917d

View file

@ -839,7 +839,11 @@ bool event_handler::handle_event_command(const queued_event& event_info, const s
return rval;
}
std::cerr << "set speaker to '" << speaker->second.description() << "'\n";
if(speaker != units->end()) {
std::cerr << "set speaker to '" << speaker->second.description() << "'\n";
} else {
std::cerr << "no speaker\n";
}
const std::string& sfx = cfg["sound"];
if(sfx != "") {