Properly walk through lists of (extended) ADGameDescriptions -- we previously only checked the first byte, which 'often' worked fine on little endian machines, but almost never worked correct on big endian ones

svn-id: r24897
This commit is contained in:
Max Horn 2006-12-19 23:58:45 +00:00
parent 559f2b62eb
commit e0ee3fd06d

View file

@ -127,7 +127,7 @@ DetectedGameList ADVANCED_DETECTOR_DETECT_GAMES_FUNCTION(
Common::ADGameDescList descList;
const byte *descPtr;
for (descPtr = descs; *descPtr != 0; descPtr += descItemSize)
for (descPtr = descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += descItemSize)
descList.push_back((const ADGameDescription *)descPtr);
ad.registerGameDescriptions(descList);
@ -166,7 +166,7 @@ int ADVANCED_DETECTOR_DETECT_INIT_GAME(
Common::String gameid = ConfMan.get("gameid");
for (descPtr = descs; *descPtr != 0; descPtr += descItemSize)
for (descPtr = descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += descItemSize)
descList.push_back((const ADGameDescription *)descPtr);
ad.registerGameDescriptions(descList);