{"id":298253,"date":"2020-02-05T15:00:24","date_gmt":"2020-02-05T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298253"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298253","title":{"rendered":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 RunUO \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/487106\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pk\/vz\/nb\/pkvznbl6d22oijuluuu2xfoztcs.png\" alt=\"Picture 1\"><\/div>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 RunUO \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. RunUO \u2014 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u041f\u041e \u0434\u043b\u044f Ultima Online, \u0438\u0433\u0440\u044b, \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0432\u043e\u0435\u0432\u0430\u0432\u0448\u0435\u0439 \u0441\u0435\u0440\u0434\u0446\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0444\u0430\u043d\u0430\u0442\u043e\u0432 \u0436\u0430\u043d\u0440\u0430 MMORPG. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <a href=\"https:\/\/github.com\/runuo\/runuo\">RunUO<\/a> \u2013 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f MMORPG Ultima Online. \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 EA Games. RunUO \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2002\u0433, \u043d\u043e \u043e\u043d \u043d\u0435 \u0442\u0435\u0440\u044f\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c. <\/p>\n<p>  \u0426\u0435\u043b\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2013 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u043c\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u2013 \u0438\u0433\u0440\u044b (<a href=\"https:\/\/www.viva64.com\/ru\/b\/0704\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>), \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (<a href=\"https:\/\/www.viva64.com\/ru\/b\/0683\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>), \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u044b (<a href=\"http:\/\/www.viva64.com\/ru\/b\/0434\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>), \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b (<a href=\"http:\/\/www.viva64.com\/ru\/b\/0262\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>) \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 (<a href=\"https:\/\/www.viva64.com\/ru\/b\/0697\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>, <a href=\"https:\/\/www.viva64.com\/ru\/b\/0674\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>, <a href=\"http:\/\/www.viva64.com\/ru\/b\/0083\/\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a>) \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0439 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438. \u042d\u0442\u0438\u043c\u0438 \u0441\u0442\u0430\u0442\u044c\u044f\u043c\u0438 \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430\u0434\u0435\u0436\u043d\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435. \u0422\u0430\u043a\u0436\u0435, \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u043d\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445. \u042d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0438 \u0441\u0438\u043b\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0432\u0435\u0434\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c <a href=\"https:\/\/www.viva64.com\/ru\/b\/0221\/\">50 \u0447\u0430\u0441\u043e\u0432<\/a> \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u043c open-source \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u041f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043a\u043b\u0430\u0434 \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 open-source. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043a\u0443\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0442.\u0434. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <a href=\"https:\/\/www.viva64.com\/ru\/b\/0614\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e<\/a> \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0443\u0447\u043d\u044b\u043c \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432\u0435\u0434\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0441\u0451 \u0436\u0435 \u0432\u0438\u0434\u043d\u0435\u0435, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b.<\/p>\n<h2>\u0423\u0447\u0430\u0441\u0442\u043a\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0448\u0438\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h2>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3010 The return value of function &#8216;Intern&#8217; is required to be utilized. BasePaintedMask.cs 49<\/p>\n<pre><code class=\"cs\">public static string Intern( string str ) {   if ( str == null )     return null;   else if ( str.Length == 0 )     return String.Empty;    return String.Intern( str ); }  public BasePaintedMask( string staffer, int itemid )                             : base( itemid + Utility.Random( 2 ) ) {   m_Staffer = staffer;    Utility.Intern( m_Staffer ); }<\/code><\/pre>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <i>Intern()<\/i> \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0430 \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043b\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3017 A pattern was detected: (item is BasePotion) || ((item is BasePotion) &amp;&amp; &#8230;). The expression is excessive or contains a logical error. Cleanup.cs 137<\/p>\n<pre><code class=\"cs\">public static bool IsBuggable( Item item ) {   if ( item is Fists )     return false;    if ( item is ICommodity || item is Multis.BaseBoat     || item is Fish || item is BigFish     || item is BasePotion || item is Food || item is CookableFood     || item is SpecialFishingNet || item is BaseMagicFish     || item is Shoes || item is Sandals     || item is Boots || item is ThighBoots     || item is TreasureMap || item is MessageInABottle     || item is BaseArmor || item is BaseWeapon     || item is BaseClothing     || ( item is BaseJewel &amp;&amp; Core.AOS )     || ( item is BasePotion &amp;&amp; Core.ML )   {     ....   } }<\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c. \u0412\u044b\u043f\u0438\u0448\u0443 \u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435:  <\/p>\n<pre><code class=\"cs\">if (item is BasePotion || ( item is BasePotion &amp;&amp; Core.ML ))<\/code><\/pre>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, <i>item is BasePotion = true<\/i>, \u0442\u043e\u0433\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 <i>Core.ML<\/i>. \u0415\u0441\u043b\u0438 \u0436\u0435 <i>item is BasePotion = false<\/i>, \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0436\u043d\u044b\u043c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>Core.ML<\/i>. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0445\u0443\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0448\u0438\u0431\u0441\u044f \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435 \u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3031 An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;bPlayerOnly&#8217; and &#8216;!bPlayerOnly&#8217;. BaseCreature.cs 3005<\/p>\n<pre><code class=\"cs\">public virtual double GetFightModeRanking( Mobile m,                                            FightMode acqType,                                            bool bPlayerOnly ) {   if ( ( bPlayerOnly &amp;&amp; m.Player ) ||  !bPlayerOnly )   {     ....   }   .... }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u043c. \u0415\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b &#8216;||&#8217; \u0441\u0442\u043e\u044f\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043f\u043e\u0434\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043c \u0435\u0433\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">if ( m.Player || !bPlayerOnly )<\/code><\/pre>\n<p>  \u0442\u043e \u0440\u043e\u0432\u043d\u044b\u043c \u0441\u0447\u0435\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3001 There are identical sub-expressions &#8216;deed is SmallBrickHouseDeed&#8217; to the left and to the right of the &#8216;||&#8217; operator. RealEstateBroker.cs 132<\/p>\n<pre><code class=\"cs\">public int ComputePriceFor( HouseDeed deed ) {   int price = 0;    if ( deed is SmallBrickHouseDeed ||    \/\/ &lt;=        deed is StonePlasterHouseDeed ||        deed is FieldStoneHouseDeed ||        deed is SmallBrickHouseDeed ||    \/\/ &lt;=        deed is WoodHouseDeed ||        deed is WoodPlasterHouseDeed ||        deed is ThatchedRoofCottageDeed )       .... }<\/code><\/pre>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u0442\u0443\u0442 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c, \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439, \u0438\u043b\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3067 It is possible that &#8216;else&#8217; block was forgotten or commented out, thus altering the program&#8217;s operation logics. BaseHouse.cs 1558<\/p>\n<pre><code class=\"cs\">private void SetLockdown( Item i, bool locked, bool checkContains ) {   if ( m_LockDowns == null )     return;    #region Mondain's Legacy   if ( i is BaseAddonContainer )     i.Movable = false;   else   #endregion    i.Movable = !locked;   i.IsLockedDown = locked;    .... }<\/code><\/pre>\n<p>  \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0435\u0434\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <i>#endregion. <\/i>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0432\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442, \u0431\u0443\u0434\u0442\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0430 <\/p>\n<pre><code class=\"cs\">i.Movable = !locked;<\/code><\/pre>\n<p>  \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>i<\/i>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0443\u0442 \u0431\u044b\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044b \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438\u2026 \u0412 \u043e\u0431\u0449\u0435\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3043 The code&#8217;s operational logic does not correspond with its formatting. The statement is indented to the right, but it is always executed. It is possible that curly brackets are missing. Earthquake.cs 57<\/p>\n<pre><code class=\"cs\">public override void OnCast() {   if ( Core.AOS )   {     damage = m.Hits \/ 2;      if ( !m.Player )       damage = Math.Max( Math.Min( damage, 100 ), 15 );       damage += Utility.RandomMinMax( 0, 15 );            \/\/ &lt;=    }   else   {     ....   } }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u044b \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438. \u0422\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437-\u0437\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u0442\u0435\u043b\u0435 <i>if ( !m.Player )<\/i>. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3083 Unsafe invocation of event &#8216;ServerStarted&#8217;, NullReferenceException is possible. Consider assigning event to a local variable before invoking it. EventSink.cs 921<\/p>\n<pre><code class=\"cs\">public static void InvokeServerStarted() {   if ( ServerStarted != null )     ServerStarted(); }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <i>RefreshStarted<\/i>, \u043d\u0430 \u0447\u0442\u043e \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. <\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u043e\u043d \u043e\u043f\u0430\u0441\u0435\u043d? \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0423 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <i>ServerStarted <\/i> \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a. \u0418 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430 null \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <i>ServerStarted()<\/i> \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u043e\u0442\u043f\u0438\u0441\u043a\u0430 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <i>NullReferenceException<\/i>. <\/p>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u2013 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;:<\/p>\n<pre><code class=\"cs\">public static void InvokeServerStarted() {   ServerStarted?.Invoke(); }<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3054 Potentially unsafe double-checked locking. Use volatile variable(s) or synchronization primitives to avoid this. Item.cs 1624  <\/p>\n<pre><code class=\"cs\">private Packet m_RemovePacket; .... private object _rpl = new object(); public Packet RemovePacket {   get   {     if (m_RemovePacket == null)     {       lock (_rpl)       {         if (m_RemovePacket == null)         {           m_RemovePacket = new RemoveItem(this);           m_RemovePacket.SetStatic();         }       }     }      return m_RemovePacket;   } }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u00ab\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439\u00bb (double checked locking). \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043a\u043e\u0434\u0430, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u2014 \u041e\u0434\u0438\u043d\u043e\u0447\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 <i>Packet<\/i>, \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <i>RemovePacket<\/i>, \u0433\u0435\u0442\u0442\u0435\u0440 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u043b\u044f <i>m_RemovePacket<\/i> \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u044e. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0432 \u0442\u0435\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>lock<\/i>, \u0433\u0434\u0435 \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044f <i>m_RemovePacket<\/i>. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>m_RemovePacket<\/i> \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043d\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u043b \u043c\u0435\u0442\u043e\u0434 <i>SetStatic().<\/i> \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <i>RemovePacket<\/i> \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <i>m_RemovePacket <\/i> \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u044e \u0443\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442, \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0442\u0435\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>lock <\/i> \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <i>Packet<\/i>, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434 <i>SetStatic(),<\/i> \u0430 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0451 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>m_RemovePacket<\/i>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>lock<\/i> \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">lock (_rpl) {   if (m_RemovePacket == null)   {     Packet instance = new RemoveItem(this);     instance.SetStatic();     m_RemovePacket = instance;   } }<\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430, \u0438 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442: \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <i>volatile<\/i>. \u0412 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <i>SetStatic()<\/i> \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>instance <\/i> \u043f\u043e\u043b\u044e <i>m_RemovePacket<\/i> (\u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0430). \u0418 \u043c\u044b \u043e\u043f\u044f\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0441 \u0447\u0435\u0433\u043e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0434\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>m_RemovePacket<\/i>. \u041d\u0435\u043b\u044c\u0437\u044f \u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435, \u0438 \u0441\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435: \u043d\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044f CLR, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u0442.\u043f. \u041e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0432\u0441\u0451 \u0436\u0435 \u0441\u0442\u043e\u0438\u0442, \u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 (\u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c) \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <i>volatile<\/i>. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c <i>volatile<\/i>, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u043c \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u041e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">private volatile Packet m_RemovePacket; .... private object _rpl = new object(); public Packet RemovePacket {   get   {     if (m_RemovePacket == null)     {       lock (_rpl)       {         if (m_RemovePacket == null)         {           Packet instance = new RemoveItem(this);           instance.SetStatic();           m_RemovePacket = instance;         }       }     }      return m_RemovePacket;   } }<\/code><\/pre>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <i>volatile <\/i> \u043f\u043e\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437-\u0437\u0430 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043f\u043e\u043b\u044e. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u043e\u0442\u043c\u0435\u0442\u0438\u0432 \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044f \u043d\u0443\u0436\u043d\u0430 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437 (\u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443), \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u043a\u0430\u043a <i>volatile<\/i> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u0435\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043a \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u043e\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f <i>volatile<\/i> \u043f\u043e\u043b\u044f, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <i>Lazy&lt;T&gt;<\/i> \u0434\u043b\u044f backing \u043f\u043e\u043b\u044f <i>m_RemovePacket<\/i> \u0432\u043c\u0435\u0441\u0442\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043b\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c-\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 <i>Lazy&lt;T&gt;<\/i>:<\/p>\n<pre><code class=\"cs\">private Lazy&lt;Packet&gt; m_RemovePacket = new Lazy&lt;Packet&gt;(() =&gt;   {     Packet instance = new RemoveItem(this);     instance.SetStatic();     return instance;   }, LazyThreadSafetyMode.ExecutionAndPublication);  .... public Packet RemovePacket {   get   {     return m_RemovePacket.Value;   } }<\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434-\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u0442\u0438\u043f\u0430 <i>Lazy<\/i>, \u043f\u0440\u0438\u0447\u0451\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u0438\u043c \u0442\u0438\u043f\u043e\u043c <i>Lazy&lt;T&gt;<\/i> (\u0440\u0435\u0436\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 <i>Lazy<\/i>).<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3131 The expression &#8216;targeted&#8217; is checked for compatibility with the type &#8216;IAxe&#8217;, but is casted to the &#8216;Item&#8217; type. HarvestTarget.cs 61<\/p>\n<pre><code class=\"cs\">protected override void OnTarget( Mobile from, object targeted ) {   ....   else if ( m_System is Lumberjacking &amp;&amp;             targeted is IAxe &amp;&amp; m_Tool is BaseAxe )   {     IAxe obj = (IAxe)targeted;     Item item = (Item)targeted;     ....   }   .... }<\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>targeted <\/i> \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a \u0442\u0438\u043f\u0443 <i>IAxe<\/i>, \u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a <i>Item <\/i> \u0435\u0435 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b, \u043e \u0447\u0435\u043c \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3070 Uninitialized variable &#8216;Zero&#8217; is used when initializing the &#8216;m_LastMobile&#8217; variable. Serial.cs 29  <\/p>\n<pre><code class=\"cs\">public struct Serial : IComparable, IComparable&lt;Serial&gt; {   private int m_Serial;    private static Serial m_LastMobile = Zero;                \/\/ &lt;=   private static Serial m_LastItem = 0x40000000;    public static Serial LastMobile { .... }   public static Serial LastItem { .... }    public static readonly Serial MinusOne = new Serial( -1 );   public static readonly Serial Zero = new Serial( 0 );     \/\/ &lt;=   ....   private Serial( int serial )   {     m_Serial = serial;   }   .... }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u0443\u0442 \u043d\u0435\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u0418\u0437-\u0437\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f <i>m_LastMobile<\/i> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 <i>Zero<\/i>, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <i>Serial()<\/i>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <i>m_Serial=0<\/i>. \u0410 \u044d\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0440\u0430\u0432\u043d\u043e\u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0443 <i>new Serial(0)<\/i>. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0447\u0442\u043e <i>serial <\/i> \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u044b\u043c <i>0<\/i>, \u0435\u0441\u043b\u0438 \u0431 \u0442\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u0431\u044b \u043a \u043e\u0448\u0438\u0431\u043a\u0435.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3063 A part of conditional expression is always true if it is evaluated: m_Serial &lt;= 0x7FFFFFFF. Serial.cs 83<\/p>\n<pre><code class=\"cs\">public bool IsItem {   get   {     return ( m_Serial &gt;= 0x40000000 &amp;&amp; m_Serial &lt;= 0x7FFFFFFF );   } }<\/code><\/pre>\n<p>  <i>0x7FFFFFFF<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0441\u0435\u0431\u044f <i>Int32<\/i>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a\u043e\u0435 \u0431\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>m_Serial<\/i>, \u043e\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e <i>0x7FFFFFFF<\/i>.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3004 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. Serialization.cs 1571<\/p>\n<pre><code class=\"cs\">public override void WriteDeltaTime( DateTime value ) {   ....   try    {      d = new TimeSpan( ticks-now );    }   catch    {     if( ticks &lt; now )        d = TimeSpan.MaxValue;      else        d = TimeSpan.MaxValue;   }   .... }<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043a\u043e\u0434\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u0430\u044f \u0438 \u043b\u043e\u0436\u043d\u0430\u044f \u0432\u0435\u0442\u0432\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>if<\/i> \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0435\u0442\u043e\u043a \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c <i>TimeSpan.MinValue. <\/i>\u042d\u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0441\u044f \u0435\u0449\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445:<\/p>\n<p>  V3004 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. Item.cs 2103<\/p>\n<pre><code class=\"cs\">public virtual void Serialize( GenericWriter writer ) {   ....      if( ticks &lt; now )      d = TimeSpan.MaxValue;    else      d = TimeSpan.MaxValue;      .... }<\/code><\/pre>\n<p>  V3004 The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. Serialization.cs 383<\/p>\n<pre><code class=\"cs\">public override void WriteDeltaTime( DateTime value ) {   ....      if( ticks &lt; now )      d = TimeSpan.MaxValue;    else      d = TimeSpan.MaxValue;      .... }<\/code><\/pre>\n<p>  \u00ab\u042d\u0442\u043e\u0442 \u0436\u0435\u00bb \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a, \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0442\u0443\u0442, \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0447\u0435\u043c\u0443, \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u0438 \u0431\u0435\u0437 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b, \u0431\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u044d\u0442\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3051 An excessive type cast. The object is already of the &#8216;Item&#8217; type. Mobile.cs 11237<\/p>\n<pre><code class=\"cs\">public Item Talisman {   get   {     return FindItemOnLayer( Layer.Talisman ) as Item;   } } public Item FindItemOnLayer( Layer layer ) {   .... }<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <i>as<\/i>. \u0412 \u044d\u0442\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043a\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0442 \u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u0436\u0435 \u0442\u0438\u043f\u0443.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3148 Casting potential &#8216;null&#8217; value of &#8216;toSet&#8217; to a value type can lead to NullReferenceException. Properties.cs 502<\/p>\n<pre><code class=\"cs\">public static string ConstructFromString( .... ) {   object toSet;   bool isSerial = IsSerial( type );    if ( isSerial ) \/\/ mutate into int32     type = m_NumericTypes[4];    ....   else if ( value == null )   {     toSet = null;   }   ....    if ( isSerial ) \/\/ mutate back     toSet = (Serial)((Int32)toSet);    constructed = toSet;   return null; }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>value <\/i>\u0440\u0430\u0432\u043d\u0430 <i>null<\/i>. \u0422\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>toSet <\/i>\u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <i>null<\/i>. \u0414\u0430\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>isSerial == true<\/i>, \u0442\u043e <i>toSet<\/i> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a <i>Int32<\/i>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a <i>NRE<\/i>. <\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0432, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, 0 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<pre><code class=\"cs\">toSet = (Serial)((Int32)(toSet ?? 0));<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3031 An excessive check can be simplified. The &#8216;||&#8217; operator is surrounded by opposite expressions &#8216;pack == null&#8217; and &#8216;pack != null&#8217;. BODBuyGump.cs 64  <\/p>\n<pre><code class=\"cs\">public override void OnResponse(Server.Network.NetState sender, RelayInfo info) {   ....   if ( (pack == null) ||        ((pack != null) &amp;&amp;         (!pack.CheckHold(                 m_From,                 item,                 true,                 true,                 0,                 item.PileWeight + item.TotalWeight)) ) )   {     pv.SayTo(m_From, 503204);     m_From.SendGump(new BOBGump(m_From, m_Book, m_Page, null));   }   .... }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u043e \u0447\u0435\u043c \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440: <\/p>\n<pre><code class=\"cs\">if ((pack == null) || ((pack != null) &amp;&amp; (!pack.CheckHold(....))))<\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;||&#8217; \u0441\u0442\u043e\u044f\u0442 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0422\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <i>pack != null<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435 \u0435\u043c\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <i>pack == null<\/i>, \u043f\u0440\u0438\u0447\u0451\u043c \u044d\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c &#8216;||&#8217;. \u042d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">if (pack == null || !pack.CheckHold(....))<\/code><\/pre>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3080 Possible null dereference. Consider inspecting &#8216;winner&#8217;. CTF.cs 1302<\/p>\n<pre><code class=\"cs\">private void Finish_Callback() {   ....   CTFTeamInfo winner = ( teams.Count &gt; 0 ? teams[0] : null );    ....     m_Context.Finish( m_Context.Participants[winner.TeamID] as Participant ); }<\/code><\/pre>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, <i>teams.Count<\/i> \u0440\u0430\u0432\u043d\u043e <i>0<\/i>. \u0422\u043e\u0433\u0434\u0430 <i>winner = null.<\/i> \u0418 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <i>winner.TeamID <\/i>\u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <i>null<\/i>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u043f\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3041 The expression was implicitly cast from &#8216;int&#8217; type to &#8216;double&#8217; type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) \/ Y;. StormsEye.cs 87<\/p>\n<pre><code class=\"cs\">public static void Gain( Mobile from, Skill skill )  {   ....   if ( from.Player &amp;&amp;       ( skills.Total \/ skills.Cap ) &gt;= Utility.RandomDouble())   .... }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <i>skills.Total<\/i> \u0438 <i>skills.Cap<\/i>, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0442\u0438\u043f <i>int<\/i>, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0442\u043e\u043c \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043a \u0442\u0438\u043f\u0443 <i>double<\/i>, \u043e \u0447\u0435\u043c \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3085 The name of &#8216;typeofObject&#8217; field in a nested type is ambiguous. The outer type contains static field with identical name. PropsGump.cs 744<\/p>\n<pre><code class=\"cs\">private static Type typeofObject = typeof( object ); .... private class GroupComparer : IComparer {   ....   private static Type typeofObject = typeof( Object );   .... }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043a\u043e\u0434\u0430 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>typeofObject<\/i>. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0435\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u0442\u0435\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c, \u0438 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u041b\u0443\u0447\u0448\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c, \u0434\u0430\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3140 Property accessors use different backing fields. WallBanner.cs 77<\/p>\n<pre><code class=\"cs\">private bool m_IsRewardItem;  [CommandProperty( AccessLevel.GameMaster )] public bool IsRewardItem {   get{ return m_IsRewardItem; }   set{ m_IsRewardItem = value; InvalidateProperties(); } }  private bool m_East;  [CommandProperty( AccessLevel.GameMaster )] public bool East {   get{ return m_East; }   set{ m_IsRewardItem = value; InvalidateProperties(); } }<\/code><\/pre>\n<p>  \u0410 \u0442\u0443\u0442 \u043d\u0430\u043b\u0438\u0446\u043e \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0438\u0437-\u0437\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u044b. \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 <i>set<\/i> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <i>East<\/i> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <i>m_East<\/i>, a \u043d\u0435 <i>m_IsRewardItem<\/i>.<\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/b> <\/p>\n<p>  V3012 The &#8216;?:&#8217; operator, regardless of its conditional expression, always returns one and the same value: 0xe7f. TreasureChestLevel2.cs 52<\/p>\n<p>  V3012 The &#8216;?:&#8217; operator, regardless of its conditional expression, always returns one and the same value: 0xe77. TreasureChestLevel2.cs 57<\/p>\n<pre><code class=\"cs\">private void SetChestAppearance() {   bool UseFirstItemId = Utility.RandomBool();    switch( Utility.RandomList( 0, 1, 2, 3, 4, 5, 6, 7 ) )   {     ....     case 6:\/\/ Keg       this.ItemID = ( UseFirstItemId ? 0xe7f : 0xe7f );       this.GumpID = 0x3e;       break;      case 7:\/\/ Barrel       this.ItemID = ( UseFirstItemId ? 0xe77 : 0xe77 );       this.GumpID = 0x3e;       break;   } }<\/code><\/pre>\n<p>  \u041a\u0430\u043a\u0430\u044f-\u0442\u043e \u0438\u043b\u043b\u044e\u0437\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \ud83d\ude42 \u0412\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <i>UseFirstItemId<\/i>, <i>this.ItemID <\/i>\u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u0438\u043b\u0438<i> 0xe7f <\/i>\u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438\u043b\u0438 <i>0xe77 <\/i>\u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3066 Possible incorrect order of arguments passed to &#8216;OnSwing&#8217; method: &#8216;defender&#8217; and &#8216;attacker&#8217;. BaseWeapon.cs 1188<\/p>\n<pre><code class=\"cs\">public virtual int AbsorbDamageAOS( Mobile attacker,                                     Mobile defender,                                     int damage ) {   ....   if ( weapon != null )   {     defender.FixedParticles(0x3779,                             1,                             15,                             0x158B,                             0x0,                             0x3,                             EffectLayer.Waist);     weapon.OnSwing( defender, attacker );   }   .... }  public virtual TimeSpan OnSwing( Mobile attacker, Mobile defender ) {   return OnSwing( attacker, defender, 1.0 ); }<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u043e \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u0443 <i>OnSwing() <\/i>\u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. <\/p>\n<p>  <b>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio:<\/b> V3092 Range intersections are possible within conditional expressions. Example: if (A &gt; 0 &amp;&amp; A &lt; 5) {\u2026 } else if (A &gt; 3 &amp;&amp; A &lt; 9) {\u2026 }. HouseFoundation.cs 1883<\/p>\n<pre><code class=\"cs\">public static bool IsFixture( int itemID ) {   ....   else if( itemID &gt;= 0x319C &amp;&amp; itemID &lt; 0x31B0 )      return true;   \/\/ ML doors   else if( itemID == 0x2D46 ||            itemID == 0x2D48 ||            itemID == 0x2FE2 ||            itemID == 0x2FE4 )     return true;   else if( itemID &gt;= 0x2D63 &amp;&amp; itemID &lt; 0x2D70 )     return true;   else if( itemID &gt;= 0x319C &amp;&amp; itemID &lt; 0x31AF )      return true;   .... }<\/code><\/pre>\n<p>  \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0435\u0433\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u043b\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e <i>if<\/i> \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b <i>false<\/i>. \u041f\u0440\u0438 <i>itemID <\/i> \u0440\u0430\u0432\u043d\u043e\u043c, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, <i>0x319C<\/i>, \u043c\u0435\u0442\u043e\u0434 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u0442 <i>true<\/i>. \u042d\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u043e\u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043a\u0438. <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  RunUO \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e, \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u00ab\u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439\u00bb. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430 543 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0434\u0430\u043b \u043e\u043a\u043e\u043b\u043e 500 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 (\u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044f <a href=\"https:\/\/www.viva64.com\/ru\/m\/0007\/\"><u>\u0443\u0440\u043e\u0432\u043d\u044f<\/u><\/a> Low), \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0430 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0438\u0445 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u043e\u0441\u0442\u0438. \u0427\u0442\u043e\u0431\u044b \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/www.viva64.com\/ru\/b\/0614\/\"><u>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 \u0434\u043b\u044f open source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432<\/u><\/a>.<\/p>\n<p><a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/487102\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c78\/30f\/70c\/c7830f70c5577c3d6704f254d7cad6a3.png\" align=\"left\"><\/a><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Ekaterina Nikiforova. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/487102\/\">RunUO Check by the PVS-Studio Analyzer<\/a>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/487106\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/487106\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/487106\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pk\/vz\/nb\/pkvznbl6d22oijuluuu2xfoztcs.png\" alt=\"Picture 1\"><\/div>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 RunUO \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio. RunUO \u2014 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u041f\u041e \u0434\u043b\u044f Ultima Online, \u0438\u0433\u0440\u044b, \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0432\u043e\u0435\u0432\u0430\u0432\u0448\u0435\u0439 \u0441\u0435\u0440\u0434\u0446\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0444\u0430\u043d\u0430\u0442\u043e\u0432 \u0436\u0430\u043d\u0440\u0430 MMORPG.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-298253","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298253"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298253\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}