Ticket #9193: 0001-don-t-crash-on-STOP-for-non-existent-zone.txt

File 0001-don-t-crash-on-STOP-for-non-existent-zone.txt, 890 bytes (added by fuzzie, 14 years ago)
Line 
1From 71718c30739e038c4a02d41924db7370d6a1d4ab Mon Sep 17 00:00:00 2001
2From: Alyssa Milburn <fuzzie@fuzzie.org>
3Date: Sun, 23 May 2010 12:37:28 +0200
4Subject: [PATCH 1/5] don't crash on STOP for non-existent zone
5
6---
7 engines/parallaction/exec_br.cpp | 1 +
8 1 files changed, 1 insertions(+), 0 deletions(-)
9
10diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
11index 76e6f0d..aaad180 100644
12--- a/engines/parallaction/exec_br.cpp
13+++ b/engines/parallaction/exec_br.cpp
14@@ -527,6 +527,7 @@ DECLARE_INSTRUCTION_OPCODE(endif) {
15
16 DECLARE_INSTRUCTION_OPCODE(stop) {
17 ZonePtr z = ctxt._inst->_z;
18+ if (!z) return; // insegui script has "STOP insegui", which doesn't exist
19 if (ACTIONTYPE(z) == kZoneHear) {
20 warning("Parallaction_br::instOp_stop not yet implemented for HEAR zones");
21 // TODO: stop music or sound effects generated by a zone.
22--
231.6.3.3
24