[Scummvm-cvs-logs] scummvm master -> 5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3

criezy criezy at scummvm.org
Wed Apr 24 22:56:41 CEST 2013


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

Summary:
5fc59f9bd8 SWORD1: Error our in case the resource handle is not found in lockScript


Commit: 5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3
    https://github.com/scummvm/scummvm/commit/5fc59f9bd8f0752bb5f1f81ab1c82d7276279cd3
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2013-04-24T13:55:34-07:00

Commit Message:
SWORD1: Error our in case the resource handle is not found in lockScript

This should never happen, so as per wjp suggestion makes this an error.

Changed paths:
    engines/sword1/resman.cpp



diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 3e8ee93..7222965 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -228,7 +228,9 @@ Header *ResMan::lockScript(uint32 scrID) {
 	openScriptResourceLittleEndian(scrID);
 #endif
 	MemHandle *handle = resHandle(scrID);
-	return handle != NULL ? (Header *)handle->data : NULL;
+	if (!handle)
+		error("Script resource handle %d not found", scrID);
+	return (Header *)handle->data;
 }
 
 void ResMan::unlockScript(uint32 scrID) {






More information about the Scummvm-git-logs mailing list