Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. void Creature::onAttacking(uint32_t interval)
  2. {
  3. if(!attackedCreature)
  4. return;
  5.  
  6. CreatureEventList attackEvents = getCreatureEvents(CREATURE_EVENT_ATTACK);
  7. for(CreatureEventList::iterator it = attackEvents.begin(); it != attackEvents.end(); ++it)
  8. {
  9. if(!(*it)->executeAttack(this, attackedCreature) && attackedCreature)
  10. {
  11. setAttackedCreature(NULL);
  12. setFollowCreature(NULL);
  13. onAttackedCreatureDisappear(false);
  14. return;
  15. }
  16. }
  17.  
  18. if(!attackedCreature)
  19. return;
  20.  
  21. onAttacked();
  22. attackedCreature->onAttacked();
  23. if(g_game.isSightClear(getPosition(), attackedCreature->getPosition(), true))
  24. doAttacking(interval);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement