Skip to content

Commit

Permalink
CommandMap: fixed faulty logic in event class comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Penner committed Oct 11, 2009
1 parent 3b2ce0b commit ecf8660
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/robotlegs/base/CommandMap.as
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ package org.robotlegs.base

/**
* Internal
*
*
* TODO: This needs to be documented
*/
protected var eventTypeMap:Dictionary;
Expand Down Expand Up @@ -144,14 +144,14 @@ package org.robotlegs.base
protected function routeEventToCommand(event:Event, commandClass:Class, oneshot:Boolean, originalEventClass:Class):void
{
var eventClass:Class = Object(event).constructor;
if (eventClass != originalEventClass) return;
if (!(event is originalEventClass)) return;
injector.mapValue(eventClass, event);
var command:Object = injector.instantiate(commandClass);
injector.unmap(eventClass);
command.execute();
if (oneshot)
{
unmapEvent(commandClass, event.type, eventClass);
unmapEvent(commandClass, event.type, originalEventClass);
}
}

Expand Down

0 comments on commit ecf8660

Please sign in to comment.