[Scummvm-git-logs] scummvm master -> e463287e240bb13c2003c593bcc76ca82f9d1525

alexbevi noreply at scummvm.org
Sat Oct 17 19:08:44 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
e463287e24 HARVESTER: fix for dangling reference to room name


Commit: e463287e240bb13c2003c593bcc76ca82f9d1525
    https://github.com/scummvm/scummvm/commit/e463287e240bb13c2003c593bcc76ca82f9d1525
Author: Alex Bevilacqua (alex at alexbevi.com)
Date: 2026-10-17T15:07:43-04:00

Commit Message:
HARVESTER: fix for dangling reference to room name

Assisted-by: Codex:gpt-6.1-sol

Changed paths:
    engines/harvester/cheats.cpp
    engines/harvester/npc/dialogue_runtime.h
    engines/harvester/script.cpp
    engines/harvester/script.h


diff --git a/engines/harvester/cheats.cpp b/engines/harvester/cheats.cpp
index 0652269e829..8f315166d1d 100644
--- a/engines/harvester/cheats.cpp
+++ b/engines/harvester/cheats.cpp
@@ -272,7 +272,7 @@ void CheatSystem::execute(CheatId cheatId, Script &script, const ScriptExecution
 			!activation.hasInteraction) {
 		debugC(1, kDebugGeneral,
 			"Harvester: cheat action tag produced no interaction id='%s' room='%s'",
-			describe(cheatId), executionContext.roomName().c_str());
+			describe(cheatId), executionContext.roomName());
 	}
 
 	debugC(2, kDebugGeneral,
diff --git a/engines/harvester/npc/dialogue_runtime.h b/engines/harvester/npc/dialogue_runtime.h
index 3c5d901d116..2439d201869 100644
--- a/engines/harvester/npc/dialogue_runtime.h
+++ b/engines/harvester/npc/dialogue_runtime.h
@@ -72,7 +72,7 @@ public:
 	Script &startupScript() const { return _script; }
 	Text &startupText() const { return _text; }
 	Flow &startupFlow() const { return _flow; }
-	const Common::String &currentRoomName() const { return _executionContext.roomName(); }
+	Common::String currentRoomName() const { return _executionContext.roomName(); }
 	const Common::String &genericByeTopic() const { return _genericByeTopic; }
 	bool executeActionTag(const Common::String &tag, InteractionResult &result,
 			bool allowTransitions = true) const {
diff --git a/engines/harvester/script.cpp b/engines/harvester/script.cpp
index 763586eb59a..bd69c58ef5b 100644
--- a/engines/harvester/script.cpp
+++ b/engines/harvester/script.cpp
@@ -1736,7 +1736,7 @@ bool Script::executeRoomExitCommands(const Common::String &roomName,
 
 bool Script::resolveObjectInteraction(const ObjectRecord &object, InteractionResult &result,
 		const ScriptExecutionContext &executionContext) {
-	const Common::String &roomName = executionContext.roomName();
+	const Common::String roomName = executionContext.roomName();
 	result = InteractionResult();
 	Common::String commandRoomName = roomName;
 	if (commandRoomName.empty() &&
@@ -1779,7 +1779,7 @@ bool Script::resolveObjectInteraction(const ObjectRecord &object, InteractionRes
 
 bool Script::resolveRegionInteraction(const RegionRecord &region, InteractionResult &result,
 		const ScriptExecutionContext &executionContext) {
-	const Common::String &roomName = executionContext.roomName();
+	const Common::String roomName = executionContext.roomName();
 	result = InteractionResult();
 	if (region.actionTag.empty())
 		return false;
@@ -1803,7 +1803,7 @@ bool Script::resolveRegionInteraction(const RegionRecord &region, InteractionRes
 
 bool Script::resolveUseItemInteraction(const Common::String &itemName, const ObjectRecord &target,
 		InteractionResult &result, const ScriptExecutionContext &executionContext) {
-	const Common::String &roomName = executionContext.roomName();
+	const Common::String roomName = executionContext.roomName();
 	result = InteractionResult();
 
 	const UseItemRecord *useItem = findUseItemRecord(itemName, target);
@@ -1850,7 +1850,7 @@ bool Script::executeDebugCommand(const CommandRecord &command,
 
 bool Script::executeActionTag(const Common::String &tag, InteractionResult &result,
 		bool allowTransitions, const ScriptExecutionContext &executionContext) {
-	const Common::String &roomName = executionContext.roomName();
+	const Common::String roomName = executionContext.roomName();
 	result = InteractionResult();
 	if (tag.empty())
 		return false;
@@ -1874,7 +1874,7 @@ bool Script::executeActionTag(const Common::String &tag, InteractionResult &resu
 
 bool Script::executeTimerAction(const Common::String &timerName, InteractionResult &result,
 		bool allowTransitions, const ScriptExecutionContext &executionContext) {
-	const Common::String &roomName = executionContext.roomName();
+	const Common::String roomName = executionContext.roomName();
 	result = InteractionResult();
 	if (timerName.empty())
 		return false;
diff --git a/engines/harvester/script.h b/engines/harvester/script.h
index dae5b6d7714..70cc7ff6f93 100644
--- a/engines/harvester/script.h
+++ b/engines/harvester/script.h
@@ -277,8 +277,8 @@ public:
 		return ScriptExecutionContext(monster.roomName);
 	}
 
-	const Common::String &roomName() const {
-		return _roomName ? *_roomName : "";
+	const char *roomName() const {
+		return _roomName ? _roomName->c_str() : "";
 	}
 
 private:




More information about the Scummvm-git-logs mailing list