aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/teenagent/callbacks.cpp3
-rw-r--r--engines/teenagent/resources.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 4fee6d4a9c..bd7d6f3f64 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -4041,7 +4041,8 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
case 0x9d45:
{
wait(50);
- byte attempts = ++ *(res->dseg.ptr(0xdbea));
+ byte attempts = res->dseg.get_byte(dsAddr_mansionEntryCount) + 1;
+ res->dseg.set_byte(dsAddr_mansionEntryCount, attempts);
debugC(0, kDebugCallbacks, "mansion intrusion attempt #%u", attempts);
if (attempts >= 7)
retVal = false;
diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h
index 2be3de265a..5a3b45b4ab 100644
--- a/engines/teenagent/resources.h
+++ b/engines/teenagent/resources.h
@@ -66,6 +66,8 @@ const uint16 dsAddr_currentScene = 0xb4f3; // 1 byte
// Current Music Id Playing : 0xdb90
const uint16 dsAddr_currentMusic = 0xdb90; // 1 byte
+// Counter for Mansion Intrusion Attempts : 0xdbea
+const uint16 dsAddr_mansionEntryCount = 0xdbea;// 1 byte
// Intro Credits #1 : 0xe3c2 to 0xe3e5 (Read Only)
const uint16 dsAddr_introCredits1 = 0xe3c2; // "backgrounds ..."