mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 17:47:42 +00:00
Fix infinite loop in CObjectList, and add an assert to detect invalid assignments
This commit is contained in:
@@ -34,13 +34,13 @@ void CScriptCameraHint::InitializeInArea(CStateManager& mgr) {
|
||||
if (conn.x4_msg != EScriptObjectMessage::Increment && conn.x4_msg != EScriptObjectMessage::Decrement)
|
||||
continue;
|
||||
|
||||
for (auto it = ent->GetConnectionList().begin(); it != ent->GetConnectionList().cend(); ++it) {
|
||||
for (auto it = ent->GetConnectionList().begin(); it != ent->GetConnectionList().end(); ++it) {
|
||||
const SConnection& conn2 = *it;
|
||||
if (conn2.x4_msg != EScriptObjectMessage::Increment && conn2.x4_msg != EScriptObjectMessage::Decrement)
|
||||
continue;
|
||||
TUniqueId id = mgr.GetIdForScript(conn2.x8_objId);
|
||||
if (TCastToPtr<CPathCamera>(mgr.ObjectById(id)) || TCastToPtr<CScriptSpindleCamera>(mgr.ObjectById((id)))) {
|
||||
ent->ConnectionList().erase(it);
|
||||
it = ent->ConnectionList().erase(it);
|
||||
if (x164_delegatedCamera != id)
|
||||
x164_delegatedCamera = id;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user