mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
DIRECTOR: LINGO: Don't add scripts w/o cast member
This commit is contained in:
parent
6b2ed3c8ca
commit
dabc82efdb
@ -983,7 +983,7 @@ void Cast::loadLingoContext(Common::SeekableSubReadStreamEndian &stream) {
|
||||
// actually define scripts
|
||||
for (ScriptContextHash::iterator it = _lingoArchive->lctxContexts.begin(); it != _lingoArchive->lctxContexts.end(); ++it) {
|
||||
ScriptContext *script = it->_value;
|
||||
if (!script->isFactory()) {
|
||||
if (script->_id >= 0 && !script->isFactory()) {
|
||||
if (_lingoArchive->getScriptContext(script->_scriptType, script->_id)) {
|
||||
error("Cast::loadLingoContext: Script already defined for type %s, id %d", scriptType2str(script->_scriptType), script->_id);
|
||||
}
|
||||
|
@ -921,7 +921,7 @@ ScriptContext *Lingo::compileLingoV4(Common::SeekableSubReadStreamEndian &stream
|
||||
ScriptType scriptType = kCastScript;
|
||||
Common::String castName;
|
||||
CastMember *member = g_director->getCurrentMovie()->getCastMemberByScriptId(scriptId);
|
||||
uint16 castId;
|
||||
int castId;
|
||||
if (member) {
|
||||
if (member->_type == kCastLingoScript)
|
||||
scriptType = ((ScriptCastMember *)member)->_scriptType;
|
||||
@ -931,8 +931,9 @@ ScriptContext *Lingo::compileLingoV4(Common::SeekableSubReadStreamEndian &stream
|
||||
if (info)
|
||||
castName = info->name;
|
||||
} else {
|
||||
warning("Script %d has no associated cast member", scriptId);
|
||||
scriptType = kNoneScript;
|
||||
castId = -1;
|
||||
warning("Script %d has invalid cast member %d", scriptId, castId);
|
||||
}
|
||||
|
||||
_assemblyArchive = archive;
|
||||
|
@ -150,7 +150,7 @@ void LM::m_dispose(int nargs) {
|
||||
|
||||
/* ScriptContext */
|
||||
|
||||
ScriptContext::ScriptContext(Common::String name, LingoArchive *archive, ScriptType type, uint16 id)
|
||||
ScriptContext::ScriptContext(Common::String name, LingoArchive *archive, ScriptType type, int id)
|
||||
: Object<ScriptContext>(name), _archive(archive), _scriptType(type), _id(id) {
|
||||
_objType = kScriptObj;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ class ScriptContext : public Object<ScriptContext> {
|
||||
public:
|
||||
LingoArchive *_archive;
|
||||
ScriptType _scriptType;
|
||||
uint16 _id;
|
||||
int _id;
|
||||
Common::Array<Common::String> _functionNames; // used by cb_localcall
|
||||
SymbolHash _functionHandlers;
|
||||
Common::HashMap<uint32, Symbol> _eventHandlers;
|
||||
@ -190,7 +190,7 @@ public:
|
||||
Common::HashMap<uint32, Datum> _objArray;
|
||||
|
||||
public:
|
||||
ScriptContext(Common::String name, LingoArchive *archive = nullptr, ScriptType type = kNoneScript, uint16 id = 0);
|
||||
ScriptContext(Common::String name, LingoArchive *archive = nullptr, ScriptType type = kNoneScript, int id = 0);
|
||||
ScriptContext(const ScriptContext &sc);
|
||||
virtual ~ScriptContext();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user