[Scummvm-git-logs] scummvm master -> 441b818d6c53757cb2294b704b9a911689ade112

whoozle noreply at scummvm.org
Mon Mar 9 01:39:30 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:
441b818d6c PHOENIXVR: skip non-existent warps/indices in setCursor/hideCursor


Commit: 441b818d6c53757cb2294b704b9a911689ade112
    https://github.com/scummvm/scummvm/commit/441b818d6c53757cb2294b704b9a911689ade112
Author: Vladimir Menshakov (vladimir.menshakov at gmail.com)
Date: 2026-03-09T01:37:20Z

Commit Message:
PHOENIXVR: skip non-existent warps/indices in setCursor/hideCursor

Changed paths:
    engines/phoenixvr/phoenixvr.cpp
    engines/phoenixvr/script.cpp


diff --git a/engines/phoenixvr/phoenixvr.cpp b/engines/phoenixvr/phoenixvr.cpp
index 3c429a96491..a891d589101 100644
--- a/engines/phoenixvr/phoenixvr.cpp
+++ b/engines/phoenixvr/phoenixvr.cpp
@@ -290,12 +290,30 @@ void PhoenixVREngine::setCursorDefault(int idx, const Common::String &path) {
 
 void PhoenixVREngine::setCursor(const Common::String &path, const Common::String &wname, int idx) {
 	debug("setCursor %s %s:%d", path.c_str(), wname.c_str(), idx);
-	_cursors[_script->getWarp(wname)][idx] = path;
+	auto warp = _script->getWarp(wname);
+	if (warp < 0) {
+		debug("no warp %s", wname.c_str());
+		return;
+	}
+	auto &cursors = _cursors[warp];
+	if (idx >= 0 && idx < static_cast<int>(cursors.size()))
+		cursors[idx] = path;
+	else
+		debug("index %d is out of range", idx);
 }
 
-void PhoenixVREngine::hideCursor(const Common::String &warp, int idx) {
-	debug("hide cursor %s:%d", warp.c_str(), idx);
-	_cursors[_script->getWarp(warp)][idx].clear();
+void PhoenixVREngine::hideCursor(const Common::String &wname, int idx) {
+	debug("hide cursor %s:%d", wname.c_str(), idx);
+	auto warp = _script->getWarp(wname);
+	if (warp < 0) {
+		debug("no warp %s", wname.c_str());
+		return;
+	}
+	auto &cursors = _cursors[warp];
+	if (idx >= 0 && idx < static_cast<int>(cursors.size()))
+		cursors[idx].clear();
+	else
+		debug("index %d is out of range", idx);
 }
 
 void PhoenixVREngine::declareVariable(const Common::String &name) {
diff --git a/engines/phoenixvr/script.cpp b/engines/phoenixvr/script.cpp
index e1035b8cfbe..6acf8711443 100644
--- a/engines/phoenixvr/script.cpp
+++ b/engines/phoenixvr/script.cpp
@@ -372,7 +372,8 @@ Script::~Script() {
 }
 
 int Script::getWarp(const Common::String &name) const {
-	return _warpsIndex.getVal(name);
+	auto it = _warpsIndex.find(name);
+	return it != _warpsIndex.end() ? it->_value : -1;
 }
 
 Script::ConstWarpPtr Script::getWarp(int idx) const {




More information about the Scummvm-git-logs mailing list