Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CRelayTracker::SendMsgs(const TAreaId& areaId, CStateManager& stateMgr)
- {
- const CWorld* world = stateMgr.GetWorld();
- u32 relayCount = world->GetRelayCount();
- bool hasInactiveRelays = false;
- for (u32 i=0 ; i<relayCount ; ++i)
- {
- const CWorld::CRelay& relay = world->GetRelay(i);
- if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
- continue;
- if (!HasRelay(relay.GetRelayId()))
- continue;
- stateMgr.SendScriptMsg(kInvalidUniqueId, relay.GetTargetId(), EScriptObjectMessage(relay.GetMessage()),
- EScriptObjectState::Any);
- if (!relay.GetActive())
- hasInactiveRelays = true;
- }
- if (!hasInactiveRelays)
- return;
- for (u32 i=0 ; i<relayCount ; ++i)
- {
- const CWorld::CRelay& relay = world->GetRelay(i);
- if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
- continue;
- if (!HasRelay(relay.GetRelayId()))
- continue;
- RemoveRelay(relay.GetRelayId());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement