{"id":318502,"date":"2021-02-24T09:00:56","date_gmt":"2021-02-24T09:00:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318502"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318502","title":{"rendered":"Free Heroes of might and magic 2 \u2013 open-source \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0440\u0435\u043b\u0438\u0437\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 fheroes2. \u0423 \u043d\u0430\u0441 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a\u0430\u043c\u0438 \u0441\u0435\u0440\u0438\u0438 \u0438\u0433\u0440 Heroes of Might and Magic, \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/78b\/f8a\/da0\/78bf8ada0ea4856f8013be89764d6091.png\" width=\"580\" height=\"360\"><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/h3>\n<p>Free Heroes of Might and Magic II \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Heroes of Might and Magic II \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u0443\u0436\u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f Heroes of Might and Magic II \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u0435\u0451 \u0434\u0435\u043c\u043e\u0432\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/github.com\/ihhub\/fheroes2\/tree\/master\/script\/demo\">\u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/a> (\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0433\u0440\u0443. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0444\u0430\u0439\u043b fheroes2.cfg, \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code>heroes speed = 10 ai speed = 10 battle speed = 10 <\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0432\u043e\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <em>videomode<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0438\u0433\u0440\u0443 \u0438 \u0443\u0432\u0438\u0434\u0435\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/580\/d90\/f89\/580d90f890abd8a0e21defd2ad7f6767.png\" width=\"580\" height=\"326\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0435 \u0441\u0432\u043e\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u043b\u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0433\u0440\u0443 \u0432 \u043f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 f4. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u044f \u0437\u0430\u0448\u0451\u043b \u0432 standard game. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0432\u044b\u043a\u0430\u0447\u0430\u043b \u0434\u0435\u043c\u043e\u0432\u0435\u0440\u0441\u0438\u044e, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0430 \u043a\u0430\u0440\u0442\u0430 \u2013 Broken Alliance.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71c\/830\/569\/71c830569568c0869dd61988cca90f34.png\" width=\"580\" height=\"326\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u043e\u043a\u043e\u0448\u043a\u0438 \u0441 \u043a\u0430\u0440\u0442\u043e\u0439, \u0433\u0435\u0440\u043e\u044f\u043c\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430. \u0418\u0418, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c, \u0441\u0443\u0434\u044f \u043f\u043e \u043e\u0442\u0437\u044b\u0432\u0430\u043c, \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0438\u0433\u0440\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u0441\u0442\u0440\u043e \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0438 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u0435\u0440\u0451\u0442\u0441\u044f. \u0412 \u043e\u0431\u0449\u0435\u043c, \u044f \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0431\u0435\u0433\u0430\u043b \u0438 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0430 0.8.4, \u0432 \u043d\u0435\u0439 \u0431\u044b\u043b\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0433\u0440\u044b \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439\u043d\u044b\u0445 \u0438 \u043a\u043e\u0441\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/ihhub\/fheroes2\/releases\/tag\/0.8.4\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0451 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u043b\u0430 \u043d\u0430\u0434\u043f\u0438\u0441\u044c: &#171;\u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430 \u0431\u0430\u0433\u043e\u0432 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439&#187;. \u0427\u0442\u043e \u0436, \u0432\u0438\u0434\u0438\u043c\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u0441\u043b\u0435\u0434\u044f\u0442 \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub, \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 Sonar Cxx \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c Cppcheck. <\/p>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0430\u0441\u0442\u0440\u043e\u043b\u043e\u0433\u0438 \u043e\u0431\u044a\u044f\u0432\u044f\u0442 \u043d\u0435\u0434\u0435\u043b\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u044f\u0442 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0441\u0432\u043e\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 PVS-Studio, \u0431\u0430\u0433\u043e\u0432 \u0441\u0442\u0430\u043d\u0435\u0442 \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0439 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio <a href=\"https:\/\/www.viva64.com\/ru\/open-source-license\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>.<\/p>\n<h3>\u041c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u043d\u0435 \u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043a\u043e\u0434, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c &#171;\u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438&#187; \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 PVS-Studio, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>\u041c\u044b \u043d\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u0433\u0440\u044b. \u041f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 <a href=\"https:\/\/www.viva64.com\/ru\/inspections\/\">\u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445<\/a> \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432 \u0442\u0435\u043d\u0438.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N1<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;list&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. tools.cpp 231<\/p>\n<pre><code>std::list StringSplit( const std::string &amp; str, ....) {   ....   while (....)    {     list.push_back( str.substr( pos1, pos2 - pos1 ) );     ....   }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>emplace_back<\/em>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0438\u043a\u043b\u0435. <\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0430\u0436\u043d\u043e, \u0432\u0435\u0434\u044c \u0432 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;loop_sounds&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. agg.cpp 461<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;projectileOffset&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. bin_info.cpp 183<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 264<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 288<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 433<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N2<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v814\/\">V814<\/a> Decreased performance. The &#8216;strlen&#8217; function was called multiple times inside the body of a loop. tools.cpp 216<\/p>\n<pre><code>void StringReplace( std::string &amp; dst,                      const char * pred,                      const std::string &amp; src ) {   size_t pos = std::string::npos;   while ( std::string::npos != ( pos = dst.find( pred ) ) )   {     dst.replace( pos, std::strlen( pred ), src );   } } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>strlen<\/em> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 <em>pred<\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0430\u043c\u044b\u043c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u043d\u0435\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0446\u0438\u043a\u043b\u0430 \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0432 \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<pre><code>void StringReplace( std::string &amp; dst,                     const char * pred,                      const std::string &amp; src ) {   size_t pos = std::string::npos;   const size_t predSize = std::strlen( pred);   while ( std::string::npos != ( pos = dst.find( pred ) ) )   {     dst.replace( pos, predSize, src );   } } <\/code><\/pre>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N3<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v827\/\">V827<\/a> Maximum size of the &#8216;optionAreas&#8217; vector is known at compile time. Consider pre-allocating it by calling optionAreas.reserve(6) battle_dialogs.cpp 217<\/p>\n<pre><code>void Battle::DialogBattleSettings( .... ) {   std::vector optionAreas;   optionAreas.push_back( fheroes2::Rect( pos_rt.x + 36,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 128,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 220,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 36,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 128,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) );   optionAreas.push_back( fheroes2::Rect( pos_rt.x + 220,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) ); } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b <em>std::vector<\/em>, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c:<\/p>\n<pre><code>optionAreas.reserve(6); <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <em>push_back<\/em> \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043d\u043e\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u0443 \u0438\u043b\u0438, \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <em>std::array<\/em>.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N4.0, 4.1&#8230;4.7<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBar)&#8217; check can be removed. kingdom_overview.cpp 62<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (artifactsBar)&#8217; check can be removed. kingdom_overview.cpp 64<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (secskillsBar)&#8217; check can be removed. kingdom_overview.cpp 66<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (primskillsBar)&#8217; check can be removed. kingdom_overview.cpp 68<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBarGuard)&#8217; check can be removed. kingdom_overview.cpp 279<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBarGuest)&#8217; check can be removed. kingdom_overview.cpp 281<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (dwellingsBar)&#8217; check can be removed. kingdom_overview.cpp 283<\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>Clear<\/em>, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0438\u0436\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<pre><code>void Clear( void ) {   if ( armyBar )     delete armyBar;   if ( artifactsBar )     delete artifactsBar;   if ( secskillsBar )     delete secskillsBar;   if ( primskillsBar )     delete primskillsBar; }  void Clear( void ) {   if ( armyBarGuard )     delete armyBarGuard;   if ( armyBarGuest )     delete armyBarGuest;   if ( dwellingsBar )     delete dwellingsBar; } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u0434\u0430, \u0443\u0431\u0440\u0430\u0432 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0432\u0435\u0434\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete<\/em> \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0438 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u0443\u0431\u0435\u0440\u0451\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438), \u043e\u0434\u043d\u0430\u043a\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043a\u043e\u0434 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<h3>General Analysis<\/h3>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/strong><\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b 2 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V654 The condition &#8216;i &lt; originalPalette.size()&#8217; of loop is always false. battle_interface.cpp 3689<\/p>\n<\/li>\n<li>\n<p>V621 Consider inspecting the &#8216;for&#8217; operator. It&#8217;s possible that the loop will be executed incorrectly or won&#8217;t be executed at all. battle_interface.cpp 3689<\/p>\n<\/li>\n<\/ul>\n<pre><code>void Battle::Interface::RedrawActionBloodLustSpell( Unit &amp; target ) {   std::vector &gt; originalPalette;   if ( target.Modes( SP_STONE ) )    {     originalPalette.push_back( PAL::GetPalette( PAL::GRAY ) );   }   else if ( target.Modes( CAP_MIRRORIMAGE ) )    {     originalPalette.push_back( PAL::GetPalette( PAL::MIRROR_IMAGE ) );   }   if ( !originalPalette.empty() )    {     for ( size_t i = 1; i &lt; originalPalette.size(); ++i )     {       originalPalette[0] = PAL::CombinePalettes( originalPalette[0],                                                  originalPalette[i] );     }     fheroes2::ApplyPalette( unitSprite, originalPalette[0] );   } .... } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043e\u0448\u0438\u0431\u0441\u044f \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435. \u041f\u043e \u0445\u043e\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440 <em>originalPalette<\/em> \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c. \u0412 <em>if<\/em> \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043d\u0430\u0434 \u0446\u0438\u043a\u043b\u043e\u043c, \u043c\u044b \u0432\u043e\u0439\u0434\u0451\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 <em>originalPalette.size()<\/em> \u0440\u0430\u0432\u0435\u043d \u0435\u0434\u0438\u043d\u0438\u0446\u0435. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>i<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u0438 \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N6<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v547\/\">V547<\/a> Expression &#8216;palette.empty()&#8217; is always true. image_tool.cpp 32<\/p>\n<pre><code>const std::vector PALPAlette() {   std::vector palette;   if (palette.empty()) \/\/&lt;=   {     palette.resize( 256 * 3 );     for ( size_t i = 0; i &lt; palette.size(); ++i )      {       palette[i] = kb_pal[i] &lt;&lt; 2;     }   }   return palette; } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440, \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u043a\u043e\u0434, \u0443\u0431\u0440\u0430\u0432 \u0435\u0451.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N7<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v668\/\">V668<\/a> There is no sense in testing the &#8216;listlog&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. battle_interface.cpp 986<\/p>\n<pre><code>Battle::Interface::Interface(....) {   ....   listlog = new StatusListBox();   ....    if ( listlog )   {     ....   }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <em>new<\/em>, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u0451\u043c. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442. \u0415\u0441\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>new<\/em> \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u044f\u0437\u044b\u043a\u0430 <em>\u0421++,<\/em> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>std::bad_alloc()<\/em> \u0417\u043d\u0430\u0447\u0438\u0442, \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0435\u0449\u0451 \u0434\u0432\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v668\/\">V668<\/a> There is no sense in testing the &#8216;elem&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. battle_arena.cpp 1079<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v668\/\">V668<\/a> There is no sense in testing the &#8216;image&#8217; pointer against null, as the memory was allocated using the &#8216;new&#8217; operator. The exception will be generated in the case of memory allocation error. battle_arena.cpp 1095<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N8<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v595\/\">V595<\/a> The &#8216;_currentUnit&#8217; pointer was utilized before it was verified against nullptr. Check lines: 2336, 2358. battle_interface.cpp 2336<\/p>\n<pre><code>void Battle::Interface::MouseLeftClickBoardAction( .... ) {   ....   themes = GetSwordCursorDirection( Board::GetDirection( index,                                    _currentUnit-&gt;GetHeadIndex()));   ....   if ( _currentUnit )   {     ....   }   .... } <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <em>_currentUnit<\/em> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>NULL<\/em>. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439: \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0439, \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0434\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043e\u043a \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0433\u0440\u044b. \u041a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439, \u0447\u0442\u043e \u043d\u0435\u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0435\u0434\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443, \u0438 \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c PVS-Studio, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0430\u0441\u044c \u0440\u0430\u043d\u0435\u0435, <a href=\"https:\/\/www.viva64.com\/ru\/open-source-license\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u0435\u043d<\/a> \u0434\u043b\u044f open-source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0440\u0443\u0442\u043e\u0439. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u0438\u0449\u0435\u0442\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u0442\u043e fheroes2 \u2013 \u0442\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<\/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: Vladislav Stolyarov. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/543868\/\">Free Heroes of Might and Magic II: Open-Source Project that You Want to Be Part of<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/543870\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/543870\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u043e \u0440\u0435\u043b\u0438\u0437\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 fheroes2. \u0423 \u043d\u0430\u0441 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a\u0430\u043c\u0438 \u0441\u0435\u0440\u0438\u0438 \u0438\u0433\u0440 Heroes of Might and Magic, \u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/h3>\n<p>Free Heroes of Might and Magic II \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Heroes of Might and Magic II \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u0443\u0436\u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f Heroes of Might and Magic II \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u0435\u0451 \u0434\u0435\u043c\u043e\u0432\u0435\u0440\u0441\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/github.com\/ihhub\/fheroes2\/tree\/master\/script\/demo\">\u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/a> (\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u043e\u0441\u0442\u0430\u043b\u044c\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u0433\u0440\u0443. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0444\u0430\u0439\u043b fheroes2.cfg, \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code>heroes speed = 10 ai speed = 10 battle speed = 10 <\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0432\u043e\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <em>videomode<\/em>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0438\u0433\u0440\u0443 \u0438 \u0443\u0432\u0438\u0434\u0435\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0435 \u0441\u0432\u043e\u0451 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u043b\u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0433\u0440\u0443 \u0432 \u043f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 f4. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u044f \u0437\u0430\u0448\u0451\u043b \u0432 standard game. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0432\u044b\u043a\u0430\u0447\u0430\u043b \u0434\u0435\u043c\u043e\u0432\u0435\u0440\u0441\u0438\u044e, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0430 \u043a\u0430\u0440\u0442\u0430 \u2013 Broken Alliance.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u043e\u043a\u043e\u0448\u043a\u0438 \u0441 \u043a\u0430\u0440\u0442\u043e\u0439, \u0433\u0435\u0440\u043e\u044f\u043c\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430. \u0418\u0418, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c, \u0441\u0443\u0434\u044f \u043f\u043e \u043e\u0442\u0437\u044b\u0432\u0430\u043c, \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0438\u0433\u0440\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u0441\u0442\u0440\u043e \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0438 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u0435\u0440\u0451\u0442\u0441\u044f. \u0412 \u043e\u0431\u0449\u0435\u043c, \u044f \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0431\u0435\u0433\u0430\u043b \u0438 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0430 0.8.4, \u0432 \u043d\u0435\u0439 \u0431\u044b\u043b\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0433\u0440\u044b \u043d\u0430 \u043d\u0438\u0437\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439\u043d\u044b\u0445 \u0438 \u043a\u043e\u0441\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/ihhub\/fheroes2\/releases\/tag\/0.8.4\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0451 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u043b\u0430 \u043d\u0430\u0434\u043f\u0438\u0441\u044c: &#171;\u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430 \u0431\u0430\u0433\u043e\u0432 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439&#187;. \u0427\u0442\u043e \u0436, \u0432\u0438\u0434\u0438\u043c\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u0441\u043b\u0435\u0434\u044f\u0442 \u0437\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub, \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 Sonar Cxx \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c Cppcheck. <\/p>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0430\u0441\u0442\u0440\u043e\u043b\u043e\u0433\u0438 \u043e\u0431\u044a\u044f\u0432\u044f\u0442 \u043d\u0435\u0434\u0435\u043b\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u044f\u0442 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0441\u0432\u043e\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 PVS-Studio, \u0431\u0430\u0433\u043e\u0432 \u0441\u0442\u0430\u043d\u0435\u0442 \u0435\u0449\u0451 \u043c\u0435\u043d\u044c\u0448\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0439 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio <a href=\"https:\/\/www.viva64.com\/ru\/open-source-license\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>.<\/p>\n<h3>\u041c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u043d\u0435 \u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u0430 \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043a\u043e\u0434, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c &#171;\u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438&#187; \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 PVS-Studio, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>\u041c\u044b \u043d\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u0433\u0440\u044b. \u041f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0438\u0445 <a href=\"https:\/\/www.viva64.com\/ru\/inspections\/\">\u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445<\/a> \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432 \u0442\u0435\u043d\u0438.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N1<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;list&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. tools.cpp 231<\/p>\n<pre><code>std::list StringSplit( const std::string &amp; str, ....) {   ....   while (....)    {     list.push_back( str.substr( pos1, pos2 - pos1 ) );     ....   }   .... } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>emplace_back<\/em>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0438\u043a\u043b\u0435. <\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0430\u0436\u043d\u043e, \u0432\u0435\u0434\u044c \u0432 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u044b\u043b\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;loop_sounds&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. agg.cpp 461<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;projectileOffset&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. bin_info.cpp 183<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 264<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 288<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v823\/\">V823<\/a> Decreased performance. Object may be created in-place in the &#8216;actions&#8217; container. Consider replacing methods: &#8216;push_back&#8217; -&gt; &#8217;emplace_back&#8217;. ai_normal_battle.cpp 433<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N2<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v814\/\">V814<\/a> Decreased performance. The &#8216;strlen&#8217; function was called multiple times inside the body of a loop. tools.cpp 216<\/p>\n<pre><code>void StringReplace( std::string &amp; dst,                      const char * pred,                      const std::string &amp; src ) {   size_t pos = std::string::npos;   while ( std::string::npos != ( pos = dst.find( pred ) ) )   {     dst.replace( pos, std::strlen( pred ), src );   } } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <em>strlen<\/em> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 <em>pred<\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0430\u043c\u044b\u043c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u043d\u0435\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0446\u0438\u043a\u043b\u0430 \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0432 \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<pre><code>void StringReplace( std::string &amp; dst,                     const char * pred,                      const std::string &amp; src ) {   size_t pos = std::string::npos;   const size_t predSize = std::strlen( pred);   while ( std::string::npos != ( pos = dst.find( pred ) ) )   {     dst.replace( pos, predSize, src );   } } <\/code><\/pre>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N3<\/strong><\/p>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v827\/\">V827<\/a> Maximum size of the &#8216;optionAreas&#8217; vector is known at compile time. Consider pre-allocating it by calling optionAreas.reserve(6) battle_dialogs.cpp 217<\/p>\n<pre><code>void Battle::DialogBattleSettings( .... ) {   std::vector optionAreas;   optionAreas.push_back( fheroes2::Rect( pos_rt.x + 36,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 128,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 220,                                           pos_rt.y + 47,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 36,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) );    optionAreas.push_back( fheroes2::Rect( pos_rt.x + 128,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) );   optionAreas.push_back( fheroes2::Rect( pos_rt.x + 220,                                           pos_rt.y + 157,                                           panelWidth,                                           panelHeight ) ); } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b <em>std::vector<\/em>, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c:<\/p>\n<pre><code>optionAreas.reserve(6); <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <em>push_back<\/em> \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u0440\u0435\u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043d\u043e\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u041d\u0443 \u0438\u043b\u0438, \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <em>std::array<\/em>.<\/p>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f N4.0, 4.1&#8230;4.7<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBar)&#8217; check can be removed. kingdom_overview.cpp 62<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (artifactsBar)&#8217; check can be removed. kingdom_overview.cpp 64<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (secskillsBar)&#8217; check can be removed. kingdom_overview.cpp 66<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (primskillsBar)&#8217; check can be removed. kingdom_overview.cpp 68<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBarGuard)&#8217; check can be removed. kingdom_overview.cpp 279<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (armyBarGuest)&#8217; check can be removed. kingdom_overview.cpp 281<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.viva64.com\/ru\/w\/v809\/\">V809<\/a> Verifying that a pointer value is not NULL is not required. The &#8216;if (dwellingsBar)&#8217; check can be removed. kingdom_overview.cpp 283<\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>Clear<\/em>, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0438\u0436\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<pre><code>void Clear( void ) {   if ( armyBar )     delete armyBar;   if ( artifactsBar )     delete artifactsBar;   if ( secskillsBar )     delete secskillsBar;   if ( primskillsBar )     delete primskillsBar; }  void Clear( void ) {   if ( armyBarGuard )     delete armyBarGuard;   if ( armyBarGuest )     delete armyBarGuest;   if ( dwellingsBar )     delete dwellingsBar; } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043e\u0434\u0430, \u0443\u0431\u0440\u0430\u0432 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0432\u0435\u0434\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>delete<\/em> \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u0438 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0430\u043c \u0443\u0431\u0435\u0440\u0451\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438), \u043e\u0434\u043d\u0430\u043a\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043a\u043e\u0434 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<h3>General Analysis<\/h3>\n<p><strong>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 N5<\/strong><\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b 2 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>V654 The condition &#8216;i &lt; originalPalette.size()&#8217; of loop is always false. battle_interface.cpp 3689<\/p>\n<\/li>\n<li>\n<p>V621 Consider inspecting the &#8216;for&#8217; operator. It&#8217;s possible that the loop will be executed incorrectly or won&#8217;t be executed at all. battle_interface.cpp 3689<\/p>\n<\/li>\n<\/ul>\n<pre><code>void Battle::Interface::RedrawActionBloodLustSpell( Unit &amp; target ) {<\/code><\/pre>\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-318502","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318502","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=318502"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318502\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}