mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: Handle duplicate cast names
Multiple casts can have the same name. The last encountered cast with that name was save in a hashtable. Director seems to use the cast that was encountered last. This solves the problem by not writing existing cast names. It happened in the game Louis Catorze. The name mainMenu was associated with a TextCast but also a ScriptCast. The chunkexpression 'line 5 of mainMenu' is not valid for a ScriptCast.
This commit is contained in:
@@ -1205,7 +1205,12 @@ void Cast::loadCastInfo(Common::SeekableReadStreamEndian &stream, uint16 id) {
|
||||
ci->name = castInfo.strings[1].readString();
|
||||
|
||||
if (!ci->name.empty()) {
|
||||
_castsNames[ci->name] = id;
|
||||
// Multiple casts can have the same name. In director only the first one is used.
|
||||
if (!_castsNames.contains(ci->name)) {
|
||||
_castsNames[ci->name] = id;
|
||||
} else {
|
||||
debugC(4, kDebugLoading, "Cast::loadCastInfo(): duplicate cast name: %s for castIDs: %s %s", ci->name.c_str(), numToCastNum(id), numToCastNum(_castsNames[ci->name]));
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user