Some decomp fixes for CScriptGenerator::AcceptScriptMsg

This commit is contained in:
Henrique Gemignani Passos Lima 2022-11-30 23:28:00 +02:00
parent 9fd63e4649
commit b1ffc45307
No known key found for this signature in database
GPG Key ID: E224F951761145F8
1 changed files with 6 additions and 2 deletions

View File

@ -35,10 +35,13 @@ void CScriptGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sende
} }
const TUniqueId uid = stateMgr.GetIdForScript(conn.x8_objId); const TUniqueId uid = stateMgr.GetIdForScript(conn.x8_objId);
if (stateMgr.GetObjectById(uid) != nullptr) { if (uid != kInvalidUniqueId) {
const CEntity* ent = stateMgr.GetObjectById(uid);
if (ent && ent->GetActive()) {
follows.push_back(uid); follows.push_back(uid);
} }
} }
}
if (follows.empty()) { if (follows.empty()) {
follows.push_back(sender); follows.push_back(sender);
@ -82,6 +85,7 @@ void CScriptGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sende
for (u32 j = 0; j < activates.size(); ++j) { for (u32 j = 0; j < activates.size(); ++j) {
if (TCastToConstPtr<CScriptSound>(stateMgr.GetObjectById(activates[j].first))) { if (TCastToConstPtr<CScriptSound>(stateMgr.GetObjectById(activates[j].first))) {
activatesRand = j; activatesRand = j;
break;
} }
} }