Fixes casting checks
This commit is contained in:
parent
7ea00fbf4f
commit
03dd5f1926
431 changed files with 5616 additions and 6250 deletions
|
|
@ -59,20 +59,16 @@ namespace Server.Factions
|
|||
|
||||
if ( type.IsSubclassOf( typeof( Faction ) ) )
|
||||
{
|
||||
Faction faction = Construct( type ) as Faction;
|
||||
|
||||
if ( faction != null )
|
||||
if ( Construct( type ) is Faction faction )
|
||||
Faction.Factions.Add( faction );
|
||||
}
|
||||
else if ( type.IsSubclassOf( typeof( Town ) ) )
|
||||
{
|
||||
Town town = Construct( type ) as Town;
|
||||
|
||||
if ( town != null )
|
||||
if ( Construct( type ) is Town town )
|
||||
Town.Towns.Add( town );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue