Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. void CRelayTracker::SendMsgs(const TAreaId& areaId, CStateManager& stateMgr)
  2. {
  3. const CWorld* world = stateMgr.GetWorld();
  4. u32 relayCount = world->GetRelayCount();
  5.  
  6. bool hasInactiveRelays = false;
  7. for (u32 i=0 ; i<relayCount ; ++i)
  8. {
  9. const CWorld::CRelay& relay = world->GetRelay(i);
  10. if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
  11. continue;
  12.  
  13. if (!HasRelay(relay.GetRelayId()))
  14. continue;
  15.  
  16. stateMgr.SendScriptMsg(kInvalidUniqueId, relay.GetTargetId(), EScriptObjectMessage(relay.GetMessage()),
  17. EScriptObjectState::Any);
  18. if (!relay.GetActive())
  19. hasInactiveRelays = true;
  20. }
  21.  
  22. if (!hasInactiveRelays)
  23. return;
  24.  
  25. for (u32 i=0 ; i<relayCount ; ++i)
  26. {
  27. const CWorld::CRelay& relay = world->GetRelay(i);
  28. if (((relay.GetRelayId() >> 16) & 0x3FF) != areaId)
  29. continue;
  30.  
  31. if (!HasRelay(relay.GetRelayId()))
  32. continue;
  33.  
  34. RemoveRelay(relay.GetRelayId());
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement