{"id":349618,"date":"2023-06-30T15:02:22","date_gmt":"2023-06-30T15:02:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349618"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349618","title":{"rendered":"<span>\u041e\u0431\u0437\u043e\u0440 Top-3 Open Source \u0438\u0433\u0440 \u043d\u0430 C# \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0438\u0445 \u043a\u043e\u0434\u0435<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043c\u0438\u0440\u0435 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438\u0433\u0440, \u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441 \u0442\u0440\u0435\u043c\u044f \u043b\u0443\u0447\u0448\u0438\u043c\u0438 Open Source \u0438\u0433\u0440\u0430\u043c\u0438 \u043d\u0430 C# \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7e1\/ea2\/5e8\/7e1ea25e8a655a224c82f55fa58d1c5a.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image1.png\" title=\"\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7e1\/ea2\/5e8\/7e1ea25e8a655a224c82f55fa58d1c5a.png\"\/><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0441\u0435 \u0438\u0433\u0440\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 Steam \u0438 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c. \u0422\u043e\u043f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432:<\/p>\n<ol>\n<li>\n<p>\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0434\u0435\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0438\u0433\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u0438\u0433\u0440\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043f\u0435, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443? \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio, \u044f \u043d\u0430\u0448\u0451\u043b \u0432 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0431\u0437\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0447\u0443\u0436\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0432\u0435\u0434\u044c \u0442\u0430\u043a \u0432\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0435 \u0440\u0438\u0441\u043a \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \ud83d\ude42<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b? \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<h3>3 \u043c\u0435\u0441\u0442\u043e. Thrive<\/h3>\n<h4>\u041e\u0431\u0437\u043e\u0440 \u0438\u0433\u0440\u044b<\/h4>\n<p>Thrive \u2014 \u0438\u0433\u0440\u0430-\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438. \u041f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 7 \u044d\u0442\u0430\u043f\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0432\u0438\u0434\u0430 \u043e\u0442 \u043f\u0440\u043e\u043a\u0430\u0440\u0438\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 \u0434\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u043e\u0441\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0433\u0440\u0430 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437 \u0432\u0441\u0435\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u044d\u0442\u0430\u043f \u043c\u0438\u043a\u0440\u043e\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0430.<\/p>\n<p>\u0418\u0434\u0435\u044f \u0438\u0433\u0440\u044b \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 Spore, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 Thrive \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0443\u043f\u043e\u0440 \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0443\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u044d\u043d\u0435\u0440\u0433\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u044b \u043e\u0431\u0438\u0442\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0445\u0438\u0449\u043d\u044b\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0438\u043b\u0438 \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u044c \u0445\u0438\u0449\u043d\u0438\u043a\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0440\u0438\u0441\u043a\u0443\u0435\u0442\u0435 \u043e\u0431\u0440\u0435\u0447\u044c \u0441\u0432\u043e\u0439 \u0432\u0438\u0434&#8230; \u043d\u0430 \u0432\u044b\u043c\u0438\u0440\u0430\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b78\/e85\/394\/b78e85394e4e04c84c4094e8c40568a4.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image2.png\" title=\"\" width=\"780\" height=\"438\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b78\/e85\/394\/b78e85394e4e04c84c4094e8c40568a4.png\"\/><\/figure>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 <a href=\"https:\/\/github.com\/Revolutionary-Games\/Thrive\/releases\/tag\/v0.6.2\">Thrive 0.6.2<\/a>.<\/p>\n<p>Thrive \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044f \u043d\u0430\u0448\u0451\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h3>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e<\/h3>\n<pre><code class=\"cs\">private void SpawnMicrobe(Vector3 position) {   ....           cloudSystem!.AddCloud(   random.Next(0, 1) == 1 \/\/ &lt;=                           ? phosphates                           : ammonia,                         ....); }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression &#8216;random.Next(0, 1) == 1&#8217; is always false. MicrobeBenchmark.cs 520.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>random.Next(0, 1)<\/em>. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432: \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043b\u0435\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u043f\u0440\u0430\u0432\u0430\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0443\u0441\u0442\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: \u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u0442\u043e \u043f\u0440\u0430\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u2014 \u043d\u0435\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u0435\u0442\u043e\u0434 <em>random.Next(0, 1)<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 0.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043e 2:<\/p>\n<pre><code class=\"cs\">cloudSystem!.AddCloud(random.Next(0, 2) == 1 ? ....);<\/code><\/pre>\n<h3>2 \u043c\u0435\u0441\u0442\u043e. Barotrauma<\/h3>\n<p>Barotrauma \u2014 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 2D-\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434\u043b\u043e\u0434\u043a\u0438 \u0432 \u0436\u0430\u043d\u0440\u0430\u0445 survival horror \u0438 RPG. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043e\u043a\u0435\u0430\u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432 \u042e\u043f\u0438\u0442\u0435\u0440\u0430.<\/p>\n<p>\u0426\u0435\u043b\u044c \u0438\u0433\u0440\u044b \u2014 \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043d\u0430\u0441\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0440\u0438\u0437\u0438\u0441\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043b\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0440\u043e\u043b\u0435\u0439: \u043a\u0430\u043f\u0438\u0442\u0430\u043d, \u0438\u043d\u0436\u0435\u043d\u0435\u0440, \u043c\u0435\u0445\u0430\u043d\u0438\u043a, \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0441\u043b\u0443\u0436\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0432\u0440\u0430\u0447 \u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a.<\/p>\n<p>\u0420\u043e\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0433\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0443 \u0442\u0430\u043b\u0430\u043d\u0442\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0422\u0430\u043a, \u043c\u0435\u0434\u0438\u043a\u0443 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u0440\u0430\u0431\u043b\u0451\u043c \u0438\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u043e\u0442\u0441\u0442\u0440\u0435\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0442\u0443\u0440\u0435\u043b\u0435\u0439 \u043e\u0442 \u0443\u0436\u0430\u0441\u043e\u0432, \u043e\u0431\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0430\u0445 \u043e\u043a\u0435\u0430\u043d\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c41\/137\/dc9\/c41137dc94d5827d1a11a38973836136.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image3.png\" title=\"\" width=\"780\" height=\"511\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c41\/137\/dc9\/c41137dc94d5827d1a11a38973836136.png\"\/><\/figure>\n<p>\u0417\u0430\u043b\u043e\u0433 \u043f\u043e\u0431\u0435\u0434\u044b \u0432 Barotrauma \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0432\u044b\u0440\u0443\u0447\u043a\u0430, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0436\u0438\u0442\u044c \u0432 \u043c\u0440\u0430\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u044d\u0442\u043e\u0439 \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 <a href=\"https:\/\/github.com\/Regalis11\/Barotrauma\/releases\/tag\/v0.17.12.0\">Barotrauma 0.17.12.0<\/a>.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u0440\u0443\u043f\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0438 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u043d \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u044b \u0443\u0436\u0435 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/658361\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439<\/a> \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.<\/p>\n<h3>\u0411\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 null<\/h3>\n<pre><code class=\"cs\">public class Contact {   ....   public Fixture FixtureA { get; internal set; }   public Fixture FixtureB { get; internal set; }   ....   internal void Update(ContactManager contactManager)   {     Body bodyA = FixtureA.Body;     Body bodyB = FixtureB.Body;      if (FixtureA == null || FixtureB == null) \/\/ &lt;=       return;     ....       if (sensor)     {       Shape shapeA = FixtureA.Shape;       Shape shapeB = FixtureB.Shape;                       touching = Collision.Collision.TestOverlap(....,                                                   ref bodyA._xf,                                                   ref bodyB._xf);       ....     }   } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a>. The &#8216;FixtureA&#8217; object was used before it was verified against null. Check lines: 252, 255. Contact.cs 252.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a>. The &#8216;FixtureB&#8217; object was used before it was verified against null. Check lines: 253, 255. Contact.cs 253.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>FixtureA == null || FixtureB == null<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e <em>FixtureA<\/em> \u0438 <em>FixtureB<\/em> \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0432\u0435\u0434\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0435\u0449\u0451 \u0440\u0430\u043d\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cs\">Body bodyA = FixtureA.Body; \/\/ possible NullReferenceException Body bodyB = FixtureB.Body; \/\/ possible NullReferenceException  if (FixtureA == null || FixtureB == null)   return;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0443\u0433\u0440\u043e\u0437\u044b <em>NullReferenceException<\/em> \u0442\u0443\u0442 \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/97a\/76e\/1e6\/97a76e1e658658504ac7e6d7fd78bdbb.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image4.png\" title=\"\" width=\"632\" height=\"321\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97a\/76e\/1e6\/97a76e1e658658504ac7e6d7fd78bdbb.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0430. \u041d\u0430\u0434\u0451\u0436\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 <em>null<\/em> \u043a\u0430\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>FixtureA<\/em> \u0438 <em>FixtureB<\/em>, \u0442\u0430\u043a \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>FixtureA.Body<\/em> \u0438 <em>FixtureB.Body<\/em> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">Body bodyA = FixtureA?.Body; Body bodyB = FixtureB?.Body;  if (bodyA == null || bodyB == null)   return;<\/code><\/pre>\n<h3>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h3>\n<pre><code class=\"cs\">public void RecreateSprites() {   ....   if (_deformSprite != null)   {     _deformSprite.Remove();      var source = _deformSprite.Sprite.SourceElement;      _deformSprite = new DeformableSprite(source, ....);               }   ....   for (int i = 0; i &lt; DecorativeSprites.Count; i++)   {     var decorativeSprite = DecorativeSprites[i];      decorativeSprite.Remove();      var source = decorativeSprite.Sprite.SourceElement;        \/\/ &lt;=      DecorativeSprites[i] = new DecorativeSprite(source, ....);             } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3080\/\">V3080<\/a>. Possible null dereference. Consider inspecting &#8216;decorativeSprite.Sprite&#8217;. Limb.cs 462.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>NullReferenceException<\/em>. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>_deformSprite.Remove<\/em> \u0438 <em>decorativeSprite.Remove<\/em>:<\/p>\n<pre><code class=\"cs\">class DecorativeSprite : ISerializableEntity {   ....   public Sprite Sprite { get; private set; }   ....   public void Remove()   {     Sprite?.Remove();     Sprite = null;   } }  partial class DeformableSprite {   ....   public Sprite Sprite { get; private set; }   ....    public void Remove()   {     Sprite?.Remove();     Sprite = null;     ....   } }<\/code><\/pre>\n<p>\u041e\u0431\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c <em>Sprite<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>Remove<\/em> \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <em>source<\/em> \u043c\u0435\u0441\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">if (_deformSprite != null) {   var source = _deformSprite.Sprite.SourceElement; \/\/&lt;=   _deformSprite.Remove(); \/\/&lt;=    _deformSprite = new DeformableSprite(source, ....);             } .... for (int i = 0; i &lt; DecorativeSprites.Count; i++) {   var decorativeSprite = DecorativeSprites[i];    var source = decorativeSprite.Sprite.SourceElement; \/\/&lt;=   decorativeSprite.Remove(); \/\/&lt;=    DecorativeSprites[i] = new DecorativeSprite(source, ....);           }<\/code><\/pre>\n<h3>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e<\/h3>\n<pre><code class=\"cs\">private void UpdateAttack(float deltaTime) {   ....   if (pathSteering != null) \/\/ &lt;= (line 1551)   { .... }   else   {     ....     if (pathSteering != null) \/\/ &lt;= (line 1954)     {       pathSteering.SteeringSeek(....);     }     else     {       SteeringManager.SteeringSeek(....);     }      ....   }   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression &#8216;pathSteering != null&#8217; is always false. EnemyAIController.cs 1954.<\/p>\n<p>\u0417\u0430 \u0432\u0441\u0435\u043c\u0438 &#8216;&#8230;.&#8217; \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043a\u0440\u044b\u0442\u044b \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <em>pathSteering != null<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e. \u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u043c\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 403 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0431\u043b\u043e\u043a <em>else<\/em> \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 <em>if<\/em> \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>pathSteering<\/em> \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u044d\u0442\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/Regalis11\/Barotrauma\/blob\/6acac1d143d647ef10250364fe1e71039142539c\/Barotrauma\/BarotraumaShared\/SharedSource\/Characters\/AI\/EnemyAIController.cs#L1954\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>1 \u043c\u0435\u0441\u0442\u043e. Space Station 14<\/h3>\n<p>Space Station 14 \u2014 \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u043e\u043b\u0435\u0432\u0430\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0443\u044e 2D \u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u043a \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/286\/8dc\/6ef\/2868dc6ef2e2978105b1f8e897b2d797.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image5.png\" title=\"\" width=\"780\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/286\/8dc\/6ef\/2868dc6ef2e2978105b1f8e897b2d797.png\"\/><\/figure>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u0433\u0440\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043e\u0442-\u0432\u043e\u0442 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0430\u043f\u0435\u0440\u0435\u043a\u043e\u0441\u044f\u043a (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0437-\u0437\u0430 \u0432\u0430\u0441). \u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 (\u0438\u0433\u0440\u043e\u043a\u0438) \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 12 \u0433\u0440\u0443\u043f\u043f: \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0442\u0434\u0435\u043b \u0441\u043b\u0443\u0436\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0439 \u043e\u0442\u0434\u0435\u043b, \u043d\u0430\u0443\u0447\u043d\u044b\u0439 \u043e\u0442\u0434\u0435\u043b, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0439 \u043e\u0442\u0434\u0435\u043b, \u0430\u043d\u0442\u0430\u0433\u043e\u043d\u0438\u0441\u0442\u044b (\u043f\u043b\u043e\u0445\u0438\u0435 \u0440\u0435\u0431\u044f\u0442\u0430) \u0438 \u0442. \u0434.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442 2 \u0434\u043e 14 \u0440\u043e\u043b\u0435\u0439, \u0432\u0441\u0435\u0433\u043e \u0440\u043e\u043b\u0435\u0439 \u0432 \u0438\u0433\u0440\u0435 \u2014 66. \u0412\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0442\u0440\u0443\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0431\u043b\u0430\u0433\u043e \u0438\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u0434 \u0441\u0442\u0430\u043d\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/317\/695\/356\/3176953568b8c57714fdcd4124123a66.png\" alt=\"1056_Top_3_Open_Source_CSharp_Games_ru\/image6.png\" title=\"\" width=\"780\" height=\"436\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/317\/695\/356\/3176953568b8c57714fdcd4124123a66.png\"\/><\/figure>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043f\u0440\u043e\u043a\u0430\u0447\u043a\u0438, \u043d\u0438 \u041d\u041f\u0421, \u043d\u0438 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043a\u0443\u043f\u043e\u043a. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u0438\u0433\u0440\u044b \u2014 \u044d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0442\u0432\u043e\u0440\u0438\u0442\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/space-wizards\/space-station-14\">Space Station 14<\/a>.<\/p>\n<h3>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<pre><code class=\"cs\">private void OnSmokeSpread(....) {   if (.... || args.NeighborFreeTiles.Count == 0)   {      ....      return;   }   ....   if (args.NeighborFreeTiles.Count == 0 &amp;&amp; ....) \/\/ &lt;=   {     ....   } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;args.NeighborFreeTiles.Count == 0 &amp;&amp; args.Neighbors.Count > 0 &amp;&amp; component.SpreadAmount > 0&#8217; is always false. SmokeSystem.cs 128<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u0432\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <em>args.NeighborFreeTiles.Count == 0<\/em>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u0430, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u0430, \u0430 \u043a\u043e\u0434 \u0432 \u0431\u043b\u043e\u043a\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e <em>if<\/em> \u2014 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c.<\/p>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430<\/h3>\n<pre><code class=\"cs\">private void OnStateChanged(...., MobStateChangedEvent args) {   if (   args.NewMobState != MobState.Dead        || args.NewMobState != MobState.Critical) \/\/ &lt;=   {     return;   }   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression is always true. Probably the &#8216;&amp;&amp;&#8217; operator should be used here. &#8230;.\\Content.Shared\\DoAfter\\SharedDoAfterSystem.cs 49<\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 || \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &amp;&amp;.<\/p>\n<p>\u0412\u043e\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">public GasTankWindow(GasTankBoundUserInterface owner) {   ....   _spbPressure = new FloatSpinBox   {     IsValid = f => f >= 0 || f &lt;= 3000, \/\/ &lt;=     ....   };   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression &#8216;f >= 0 || f &lt;= 3000&#8217; is always true. Probably the &#8216;&amp;&amp;&#8217; operator should be used here. GasTankWindow.cs 168.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>f >= 0 || f &lt;= 3000<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u0432\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>f<\/em> \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e 0, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u2014 <em>f >= 0<\/em>, \u0430 \u0435\u0441\u043b\u0438 <em>f<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 0, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u2014 <em>f &lt;= 3000<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u043e\u0442 0 \u0434\u043e 3000. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &amp;&amp; \u0432\u043c\u0435\u0441\u0442\u043e ||:<\/p>\n<pre><code class=\"cs\">_spbPressure = new FloatSpinBox {   IsValid = f => f >= 0 &amp;&amp; f &lt;= 3000,   .... };<\/code><\/pre>\n<h3>\u0410\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0438\u0441\u043a\u0438 \u043e\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/h3>\n<pre><code class=\"cs\">protected override void Dispose(bool disposing) {   MenuBody.OnChildRemoved -= ctrl =>     _uiController.OnRemoveElement(this, ctrl);   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3084\/\">V3084<\/a>. Anonymous function is used to unsubscribe from &#8216;OnChildRemoved&#8217; event. No handlers will be unsubscribed, as a separate delegate instance is created for each anonymous function declaration. ContextMenuPopup.xaml.cs 74.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0438\u0441\u043a\u0438 \u043e\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041d\u043e \u043e\u0442\u043f\u0438\u0441\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0442. \u043a. \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430 \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u043d\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0442\u043f\u0438\u0441\u043a\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<p>\u0412\u043e\u0442 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435:<\/p>\n<pre><code class=\"cs\">public void OnRemoveElement(ContextMenuPopup menu, Control control) {   ....   element.OnMouseEntered -= _ => OnMouseEntered(element);   element.OnMouseExited -= _ => OnMouseExited(element);   element.OnKeyBindDown -= args => OnKeyBindDown(element, args);   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3084\/\">V3084<\/a>. Anonymous function is used to unsubscribe from &#8216;OnMouseEntered&#8217; event. No handlers will be unsubscribed, as a separate delegate instance is created for each anonymous function declaration. ContextMenuUIController.cs 205.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3084\/\">V3084<\/a>. Anonymous function is used to unsubscribe from &#8216;OnMouseExited&#8217; event. No handlers will be unsubscribed, as a separate delegate instance is created for each anonymous function declaration. ContextMenuUIController.cs 206.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3084\/\">V3084<\/a>. Anonymous function is used to unsubscribe from &#8216;OnKeyBindDown&#8217; event. No handlers will be unsubscribed, as a separate delegate instance is created for each anonymous function declaration. ContextMenuUIController.cs 207.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043b\u0443\u0447\u0448\u0438\u043c\u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, Open Source \u0438\u0433\u0440\u0430\u043c\u0438 \u043d\u0430 C# \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 (\u043d\u043e \u043d\u0435 \u0432\u0441\u0435) \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0451. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \ud83d\ude42<\/p>\n<p>\u0423\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432\u0430\u043c \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430! \u041f\u043e\u043a\u0430!<\/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: Andrey Moskalev. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1056\/\">Top 3 open-source games written in C#: searching for bugs<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/companies\/pvs-studio\/articles\/745108\/\"> https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/745108\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043c\u0438\u0440\u0435 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438\u0433\u0440, \u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441 \u0442\u0440\u0435\u043c\u044f \u043b\u0443\u0447\u0448\u0438\u043c\u0438 Open Source \u0438\u0433\u0440\u0430\u043c\u0438 \u043d\u0430 C# \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0441\u0435 \u0438\u0433\u0440\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 Steam \u0438 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c. \u0422\u043e\u043f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432:<\/p>\n<ol>\n<li>\n<p>\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0434\u0435\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0438\u0433\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0430\u0437 \u0443\u0436 \u0438\u0433\u0440\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043f\u0435, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443? \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio, \u044f \u043d\u0430\u0448\u0451\u043b \u0432 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0431\u0437\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0447\u0443\u0436\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0432\u0435\u0434\u044c \u0442\u0430\u043a \u0432\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0435 \u0440\u0438\u0441\u043a \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \ud83d\ude42<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b? \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c!<\/p>\n<h3>3 \u043c\u0435\u0441\u0442\u043e. Thrive<\/h3>\n<h4>\u041e\u0431\u0437\u043e\u0440 \u0438\u0433\u0440\u044b<\/h4>\n<p>Thrive \u2014 \u0438\u0433\u0440\u0430-\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438. \u041f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 7 \u044d\u0442\u0430\u043f\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0432\u0438\u0434\u0430 \u043e\u0442 \u043f\u0440\u043e\u043a\u0430\u0440\u0438\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 \u0434\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u043e\u0441\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0433\u0440\u0430 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437 \u0432\u0441\u0435\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u044d\u0442\u0430\u043f \u043c\u0438\u043a\u0440\u043e\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0430.<\/p>\n<p>\u0418\u0434\u0435\u044f \u0438\u0433\u0440\u044b \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 Spore, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 Thrive \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0443\u043f\u043e\u0440 \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0438 \u0432\u044b\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432 \u0432 \u0432\u0430\u0448\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0443\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0435\u0433\u043e \u044d\u043d\u0435\u0440\u0433\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u044b \u043e\u0431\u0438\u0442\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0445\u0438\u0449\u043d\u044b\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0438\u043b\u0438 \u0441\u0430\u043c\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u044c \u0445\u0438\u0449\u043d\u0438\u043a\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0440\u0438\u0441\u043a\u0443\u0435\u0442\u0435 \u043e\u0431\u0440\u0435\u0447\u044c \u0441\u0432\u043e\u0439 \u0432\u0438\u0434&#8230; \u043d\u0430 \u0432\u044b\u043c\u0438\u0440\u0430\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 <a href=\"https:\/\/github.com\/Revolutionary-Games\/Thrive\/releases\/tag\/v0.6.2\">Thrive 0.6.2<\/a>.<\/p>\n<p>Thrive \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044f \u043d\u0430\u0448\u0451\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h3>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e<\/h3>\n<pre><code class=\"cs\">private void SpawnMicrobe(Vector3 position) {   ....           cloudSystem!.AddCloud(   random.Next(0, 1) == 1 \/\/ &lt;=                           ? phosphates                           : ammonia,                         ....); }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression &#8216;random.Next(0, 1) == 1&#8217; is always false. MicrobeBenchmark.cs 520.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>random.Next(0, 1)<\/em>. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432: \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043b\u0435\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u043f\u0440\u0430\u0432\u0430\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0443\u0441\u0442\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: \u0435\u0441\u043b\u0438 \u043b\u0435\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d, \u0442\u043e \u043f\u0440\u0430\u0432\u0430\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u2014 \u043d\u0435\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u0435\u0442\u043e\u0434 <em>random.Next(0, 1)<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 0.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043e 2:<\/p>\n<pre><code class=\"cs\">cloudSystem!.AddCloud(random.Next(0, 2) == 1 ? ....);<\/code><\/pre>\n<h3>2 \u043c\u0435\u0441\u0442\u043e. Barotrauma<\/h3>\n<p>Barotrauma \u2014 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 2D-\u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434\u043b\u043e\u0434\u043a\u0438 \u0432 \u0436\u0430\u043d\u0440\u0430\u0445 survival horror \u0438 RPG. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043e\u043a\u0435\u0430\u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432 \u042e\u043f\u0438\u0442\u0435\u0440\u0430.<\/p>\n<p>\u0426\u0435\u043b\u044c \u0438\u0433\u0440\u044b \u2014 \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u043d\u0430\u0441\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u0440\u0438\u0437\u0438\u0441\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043b\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0440\u043e\u043b\u0435\u0439: \u043a\u0430\u043f\u0438\u0442\u0430\u043d, \u0438\u043d\u0436\u0435\u043d\u0435\u0440, \u043c\u0435\u0445\u0430\u043d\u0438\u043a, \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0441\u043b\u0443\u0436\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0432\u0440\u0430\u0447 \u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a.<\/p>\n<p>\u0420\u043e\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0433\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0443 \u0442\u0430\u043b\u0430\u043d\u0442\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0438 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0422\u0430\u043a, \u043c\u0435\u0434\u0438\u043a\u0443 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a\u043e\u0440\u0430\u0431\u043b\u0451\u043c \u0438\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u043e\u0442\u0441\u0442\u0440\u0435\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0442\u0443\u0440\u0435\u043b\u0435\u0439 \u043e\u0442 \u0443\u0436\u0430\u0441\u043e\u0432, \u043e\u0431\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0430\u0445 \u043e\u043a\u0435\u0430\u043d\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u043b\u043e\u0433 \u043f\u043e\u0431\u0435\u0434\u044b \u0432 Barotrauma \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0432\u044b\u0440\u0443\u0447\u043a\u0430, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0436\u0438\u0442\u044c \u0432 \u043c\u0440\u0430\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u044d\u0442\u043e\u0439 \u0438\u0433\u0440\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0440\u0435\u043b\u0438\u0437\u0435 <a href=\"https:\/\/github.com\/Regalis11\/Barotrauma\/releases\/tag\/v0.17.12.0\">Barotrauma 0.17.12.0<\/a>.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u0440\u0443\u043f\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u0434\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0438 \u0432 \u043f\u043b\u0430\u043d\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u043d \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u044b \u0443\u0436\u0435 \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/habr.com\/ru\/companies\/pvs-studio\/articles\/658361\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439<\/a> \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.<\/p>\n<h3>\u0411\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 null<\/h3>\n<pre><code class=\"cs\">public class Contact {   ....   public Fixture FixtureA { get; internal set; }   public Fixture FixtureB { get; internal set; }   ....   internal void Update(ContactManager contactManager)   {     Body bodyA = FixtureA.Body;     Body bodyB = FixtureB.Body;      if (FixtureA == null || FixtureB == null) \/\/ &lt;=       return;     ....       if (sensor)     {       Shape shapeA = FixtureA.Shape;       Shape shapeB = FixtureB.Shape;                       touching = Collision.Collision.TestOverlap(....,                                                   ref bodyA._xf,                                                   ref bodyB._xf);       ....     }   } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a>. The &#8216;FixtureA&#8217; object was used before it was verified against null. Check lines: 252, 255. Contact.cs 252.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a>. The &#8216;FixtureB&#8217; object was used before it was verified against null. Check lines: 253, 255. Contact.cs 253.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>FixtureA == null || FixtureB == null<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e <em>FixtureA<\/em> \u0438 <em>FixtureB<\/em> \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0432\u0435\u0434\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0435\u0449\u0451 \u0440\u0430\u043d\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cs\">Body bodyA = FixtureA.Body; \/\/ possible NullReferenceException Body bodyB = FixtureB.Body; \/\/ possible NullReferenceException  if (FixtureA == null || FixtureB == null)   return;<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0443\u0433\u0440\u043e\u0437\u044b <em>NullReferenceException<\/em> \u0442\u0443\u0442 \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0430. \u041d\u0430\u0434\u0451\u0436\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 <em>null<\/em> \u043a\u0430\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>FixtureA<\/em> \u0438 <em>FixtureB<\/em>, \u0442\u0430\u043a \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>FixtureA.Body<\/em> \u0438 <em>FixtureB.Body<\/em> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">Body bodyA = FixtureA?.Body; Body bodyB = FixtureB?.Body;  if (bodyA == null || bodyB == null)   return;<\/code><\/pre>\n<h3>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h3>\n<pre><code class=\"cs\">public void RecreateSprites() {   ....   if (_deformSprite != null)   {     _deformSprite.Remove();      var source = _deformSprite.Sprite.SourceElement;      _deformSprite = new DeformableSprite(source, ....);               }   ....   for (int i = 0; i &lt; DecorativeSprites.Count; i++)   {     var decorativeSprite = DecorativeSprites[i];      decorativeSprite.Remove();      var source = decorativeSprite.Sprite.SourceElement;        \/\/ &lt;=      DecorativeSprites[i] = new DecorativeSprite(source, ....);             } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3080\/\">V3080<\/a>. Possible null dereference. Consider inspecting &#8216;decorativeSprite.Sprite&#8217;. Limb.cs 462.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>NullReferenceException<\/em>. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>_deformSprite.Remove<\/em> \u0438 <em>decorativeSprite.Remove<\/em>:<\/p>\n<pre><code class=\"cs\">class DecorativeSprite : ISerializableEntity {   ....   public Sprite Sprite { get; private set; }   ....   public void Remove()   {     Sprite?.Remove();     Sprite = null;   } }  partial class DeformableSprite {   ....   public Sprite Sprite { get; private set; }   ....    public void Remove()   {     Sprite?.Remove();     Sprite = null;     ....   } }<\/code><\/pre>\n<p>\u041e\u0431\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c <em>Sprite<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <em>Remove<\/em> \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <em>source<\/em> \u043c\u0435\u0441\u0442\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cs\">if (_deformSprite != null) {   var source = _deformSprite.Sprite.SourceElement; \/\/&lt;=   _deformSprite.Remove(); \/\/&lt;=    _deformSprite = new DeformableSprite(source, ....);             } .... for (int i = 0; i &lt; DecorativeSprites.Count; i++) {   var decorativeSprite = DecorativeSprites[i];    var source = decorativeSprite.Sprite.SourceElement; \/\/&lt;=   decorativeSprite.Remove(); \/\/&lt;=    DecorativeSprites[i] = new DecorativeSprite(source, ....);           }<\/code><\/pre>\n<h3>\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e<\/h3>\n<pre><code class=\"cs\">private void UpdateAttack(float deltaTime) {   ....   if (pathSteering != null) \/\/ &lt;= (line 1551)   { .... }   else   {     ....     if (pathSteering != null) \/\/ &lt;= (line 1954)     {       pathSteering.SteeringSeek(....);     }     else     {       SteeringManager.SteeringSeek(....);     }      ....   }   .... }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a>. Expression &#8216;pathSteering != null&#8217; is always false. EnemyAIController.cs 1954.<\/p>\n<p>\u0417\u0430 \u0432\u0441\u0435\u043c\u0438 &#8216;&#8230;.&#8217; \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043a\u0440\u044b\u0442\u044b \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0422\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <em>pathSteering != null<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043b\u043e\u0436\u043d\u043e. \u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u043c\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 403 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0432\u0435\u0440\u0445 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0431\u043b\u043e\u043a <em>else<\/em> \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 <em>if<\/em> \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>pathSteering<\/em> \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u044d\u0442\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/Regalis11\/Barotrauma\/blob\/6acac1d143d647ef10250364fe1e71039142539c\/Barotrauma\/BarotraumaShared\/SharedSource\/Characters\/AI\/EnemyAIController.cs#L1954\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>1 \u043c\u0435\u0441\u0442\u043e. Space Station 14<\/h3>\n<p>Space Station 14 \u2014 \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u0440\u043e\u043b\u0435\u0432\u0430\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u0433\u0440\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0443\u044e 2D \u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u043a \u0438 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u0435\u0439.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u0433\u0440\u044b \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u043d\u0446\u0438\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043e\u0442-\u0432\u043e\u0442 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0430\u043f\u0435\u0440\u0435\u043a\u043e\u0441\u044f\u043a (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0437-\u0437\u0430 \u0432\u0430\u0441). \u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 (\u0438\u0433\u0440\u043e\u043a\u0438) \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 12 \u0433\u0440\u0443\u043f\u043f: \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0442\u0434\u0435\u043b \u0441\u043b\u0443\u0436\u0431\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0439 \u043e\u0442\u0434\u0435\u043b, \u043d\u0430\u0443\u0447\u043d\u044b\u0439 \u043e\u0442\u0434\u0435\u043b, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u044b\u0439 \u043e\u0442\u0434\u0435\u043b, \u0430\u043d\u0442\u0430\u0433\u043e\u043d\u0438\u0441\u0442\u044b (\u043f\u043b\u043e\u0445\u0438\u0435 \u0440\u0435\u0431\u044f\u0442\u0430) \u0438 \u0442. \u0434.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442 2 \u0434\u043e 14 \u0440\u043e\u043b\u0435\u0439, \u0432\u0441\u0435\u0433\u043e \u0440\u043e\u043b\u0435\u0439 \u0432 \u0438\u0433\u0440\u0435 \u2014 66. \u0412\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438 \u0442\u0440\u0443\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0431\u043b\u0430\u0433\u043e \u0438\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u0434 \u0441\u0442\u0430\u043d\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u043d\u0435\u0442 \u043d\u0438 \u043f\u0440\u043e\u043a\u0430\u0447\u043a\u0438, \u043d\u0438 \u041d\u041f\u0421, \u043d\u0438 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043a\u0443\u043f\u043e\u043a. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u0438\u0433\u0440\u044b \u2014 \u044d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0442\u0432\u043e\u0440\u0438\u0442\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h4>\u0420\u0430\u0437\u0431\u043e\u0440 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/space-wizards\/space-station-14\">Space Station 14<\/a>.<\/p>\n<h3>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438<\/h3>\n<pre><code class=\"cs\">private void OnSmokeSpread(....) {   if (.... || args.NeighborFreeTiles.Count == 0)   {      ....      return;   }   ....   if (args.NeighborFreeTiles.Count == 0 &amp;&amp; ....) \/\/ &lt;=   {     ....   } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-349618","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349618","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=349618"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349618\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}