2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:07:42 +00:00

RelayTracker fixes

This commit is contained in:
2016-07-25 10:58:47 -07:00
parent 9b62191975
commit ef63498c61
4 changed files with 30 additions and 28 deletions

View File

@@ -47,11 +47,11 @@ void CRelayTracker::SendMsgs(const TAreaId& areaId, CStateManager& stateMgr)
const CWorld* world = stateMgr.GetWorld();
u32 relayCount = world->GetRelayCount();
bool hasInactiveRelays = false;
bool hasActiveRelays = false;
for (u32 i=0 ; i<relayCount ; ++i)
{
const CWorld::CRelay& relay = world->GetRelay(i);
if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
if (((relay.GetTargetId() >> 16) & 0x3FF) != areaId)
continue;
if (!HasRelay(relay.GetRelayId()))
@@ -59,20 +59,20 @@ void CRelayTracker::SendMsgs(const TAreaId& areaId, CStateManager& stateMgr)
stateMgr.SendScriptMsg(kInvalidUniqueId, relay.GetTargetId(), EScriptObjectMessage(relay.GetMessage()),
EScriptObjectState::Any);
if (!relay.GetActive())
hasInactiveRelays = true;
if (relay.GetActive())
hasActiveRelays = true;
}
if (!hasInactiveRelays)
if (!hasActiveRelays)
return;
for (u32 i=0 ; i<relayCount ; ++i)
{
const CWorld::CRelay& relay = world->GetRelay(i);
if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
if (((relay.GetTargetId() >> 16) & 0x3FF) != areaId)
continue;
if (!HasRelay(relay.GetRelayId()) || relay.GetActive())
if (!HasRelay(relay.GetRelayId()) || !relay.GetActive())
continue;
RemoveRelay(relay.GetRelayId());