Replaces corpse name (#23)

This commit is contained in:
Kamron Batman 2018-08-14 23:50:00 +08:00 committed by GitHub
parent 632e8b4757
commit 6987d0c18e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
367 changed files with 378 additions and 396 deletions

View file

@ -439,21 +439,7 @@ namespace Server.Items
if ( m is BaseCreature )
{
BaseCreature bc = (BaseCreature)m;
if ( bc.CorpseNameOverride != null )
return bc.CorpseNameOverride;
}
Type t = m.GetType();
object[] attrs = t.GetCustomAttributes( typeof( CorpseNameAttribute ), true );
if ( attrs != null && attrs.Length > 0 )
{
CorpseNameAttribute attr = attrs[0] as CorpseNameAttribute;
if ( attr != null )
return attr.Name;
return bc.CorpseNameOverride ?? bc.CorpseName;
}
return null;