// Event Observer Interface
void
dmz::StarfighterPluginAces::close_event (
      const Handle EventHandle,
      const EventType &Type,
      const EventLocalityEnum Locality) {

   EventModule *event = get_event_module ();

   if (event) {

      Handle target (0);

      if (event->lookup_object_handle (EventHandle, _targetEventAttr, target)) {

         AceStruct *as = _aceTable.remove (target);

         if (as) {

            if (_common) {

               const Handle Out = _common->create_open_detonation_event (target, 0);
               Handle source (0);
               event->lookup_object_handle (EventHandle, _sourceEventAttr, source);
               event->store_object_handle (Out, _killsEventAttr, source);
               event->close_event (Out);
            }

            if (_objMod) { _objMod->destroy_object (target); }
            delete as; as = 0;
         }
      }
   }
}
Beispiel #2
0
// Event Observer Interface
void
dmz::EntityPluginDamage::close_event (
      const Handle EventHandle,
      const EventType &Type,
      const EventLocalityEnum Locality) {

   if (_hil && Type.is_of_type (_detonationType)) {

      EventModule *eventMod (get_event_module ());

      if (eventMod) {

         Handle target (0);

         if (eventMod->lookup_object_handle (EventHandle, _targetHandle, target)) {

            if (_hil == target) {

               ObjectModule *objMod (get_object_module ());

               if (objMod) {

                  Mask state;

                  objMod->lookup_state (_hil, _defaultObjectHandle, state);

                  state |= _deadState;

                  objMod->store_state (_hil, _defaultObjectHandle, state);
               }
            }
         }
      }
   }
}