@ -12,7 +12,6 @@ import engine.objects.AbstractWorldObject;
@@ -12,7 +12,6 @@ import engine.objects.AbstractWorldObject;
import engine.objects.Building ;
import engine.objects.Mob ;
import engine.objects.PlayerCharacter ;
import org.pmw.tinylog.Logger ;
/ *
* @Author :
@ -46,16 +45,19 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
@@ -46,16 +45,19 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
return true ;
AbstractWorldObject target ;
Enum . GameObjectType targetType ;
if ( msg . getTargetType ( ) = = Enum . GameObjectType . Mob . ordinal ( ) ) {
targetType = Enum . GameObjectType . values ( ) [ msg . getTargetType ( ) ] ;
if ( msg . getTargetType ( ) = = Enum . GameObjectType . Mob . ordinal ( ) ) {
target = Mob . getMob ( msg . getTargetID ( ) ) ;
} else if ( msg . getTargetType ( ) = = Enum . GameObjectType . Building . ordinal ( ) ) {
} else if ( msg . getTargetType ( ) = = Enum . GameObjectType . Building . ordinal ( ) ) {
target = BuildingManager . getBuilding ( msg . getTargetID ( ) ) ;
Building targetBuilding = ( Building ) target ;
if ( ! targetBuilding . isVulnerable ( ) | | targetBuilding . getRank ( ) < 0 ) {
playerCharacter . setCombatTarget ( null ) ;
return true ;
}
if ( ! targetBuilding . isVulnerable ( ) | | targetBuilding . getRank ( ) < 0 ) {
playerCharacter . setCombatTarget ( null ) ;
return true ;
}
} else if ( msg . getTargetType ( ) = = Enum . GameObjectType . PlayerCharacter . ordinal ( ) ) {
target = PlayerCharacter . getPlayerCharacter ( msg . getTargetID ( ) ) ;
} else {