Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SaccageSubscriber implements EventSubscriberInterface
- {
- public static function getSubscribedEvents()
- {
- return array(
- SistearthEvent::AVANT_CALCUL_PK => array(
- array(
- 'invalidatePk',
- 0
- ),
- )
- );
- }
- public function invalidatePk(SistearthCalculPkEvent $event)
- {
- $attaquant = $event->getAttaquant();
- $defenseur = $event->getDefenseur();
- if ($attaquant instanceof Joueur && $defenseur instanceof Joueur) {
- if ($this->hasSaccageActif($defenseur, $attaquant->getRoyaume())) {
- $event->setForceFalse(true);
- }
- }
- }
- [...]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement