Framework_4_0 preprocessor is necessary for legacy compatibility.
This commit is contained in:
parent
12fe97babd
commit
558fcf495a
15 changed files with 755 additions and 46 deletions
|
|
@ -25,7 +25,7 @@ namespace Server.Commands
|
|||
else
|
||||
{
|
||||
SkillName skill;
|
||||
|
||||
#if Framework_4_0
|
||||
if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
|
||||
{
|
||||
arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
|
||||
|
|
@ -34,6 +34,18 @@ namespace Server.Commands
|
|||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
|
||||
}
|
||||
catch
|
||||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +74,7 @@ namespace Server.Commands
|
|||
else
|
||||
{
|
||||
SkillName skill;
|
||||
|
||||
#if Framework_4_0
|
||||
if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
|
||||
{
|
||||
arg.Mobile.Target = new SkillTarget( skill );
|
||||
|
|
@ -71,6 +83,19 @@ namespace Server.Commands
|
|||
{
|
||||
arg.Mobile.SendMessage( "You have specified an invalid skill to get." );
|
||||
}
|
||||
#else
|
||||
try
|
||||
{
|
||||
skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
|
||||
}
|
||||
catch
|
||||
{
|
||||
arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
|
||||
return;
|
||||
}
|
||||
|
||||
arg.Mobile.Target = new SkillTarget( skill );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue